Сергей Радзыняк ".net microservices in real life"

25
.NET Microservices in Real Life Serhiy Radzyniak SoftJourn

Upload: fwdays

Post on 05-Apr-2017

85 views

Category:

Technology


0 download

TRANSCRIPT

.NET Microservices in Real LifeSerhiy RadzyniakSoftJourn

What we’ll overview1. Shortly about the system

2. System structure

3. Web services

4. Other services

5. Databases: relational and no-sql

6. Files storage

7. Scheduled tasks server

8. Caching

9. Logging and alerts

10. General features of each application

11. Development processes

12. Samples and flows

Shortly about the system

System structure

Web services

• Services that serve financial transactions

• Services that serve our applications

• Services that we develop for other clients

• Grant an access for third party developers

• API usage statistics

• API policies (e.g. number of requests per minute)

Other services• Service to perform decisioning and logging on each transaction

• Service to store files and other metadata

• Service to perform antivirus check

• Service to generate zip archives

• Service to perform fraud check

• Security and identity service Task service!

• Reliability

• Flexible Routing

• Clustering

• Federation

• Highly Available Queues

• Multi-protocol

• Many Clients

• Management UI

• Tracing

• Plugin System

Now:

• Use gmail account to programmatically send e-mails through smtp server

• Have an integration with Mandrill

Intention:

• Having separate service that will have web-api, serve messages queue and will send e-mails through mandrill

Proxy is needed to access external web-applications from internal services.E.g. files storage service need an access to AWS S3 Bucket API

Databases: MS-SQL

• Information about transactions

• Accounts and permissions

• Features specific data

• Replication

• Master (transactional) nodes vs raid (reporting) nodes

Databases: MongoDB

• Data that don’t have fixed structure (metadata)

• Log raw, current and context data of some features

• Indexes are important!

• MongoDB is hosted on real PCs

• We use tracking policies (e.g. 3/5)

Files storage

Amazon S3 Bucket

• It’s secure

• It’s distributed

• Has CDN

• Has good development API and libraries

• Ability to setup tracking policies

Scheduled tasks server

http://hangfire.io/

An easy way to perform background processing in .NET and .NET Core applications. No Windows Service or separate process required.

Backed by persistent storage. Open and free for commercial use.

Caching

• Boost but not broke!!!

• Store some temporary data

Logging and alerts

• Log files are distributed across VMs

• All the logs are monitoring by alerting system

General features of each application

• OWIN

• Relational DB layer (ADO.NET + Dapper). We don't use "heavy" ORMs (e.g. Entity Framework)

• Dependency Injection (Autofac)

• Mapping (AutoMapper)

• Auto generated documentation (Swagger)

• Logging (log4net). Request/response logging with AutofacActionFilter

• Error Handling

Development processes

• VSTS everywhere

• Private nuget packages to share functionality

Samples and flows

Task Service

Callback flow

Authentication service

Antivirus scanning

Serhiy [email protected]