Microservices
It is a greater challenge to form a team that works well together than to orchestrate microservices.
A microservice is a small, loosely coupled, distributed service. It is part of a broader microservices architecture, comprising a set of loosely coupled microservices that operate together to solve a common goal. A collection of microservices can be regarded as a system.
Follow Fred George, he coined the name microservices.
Software architecture matches dynamics of the team that created it - Conway's Law
Benefits
- Focused domain expertise
- Pick the right tool for the job
Challenges
- Deployment strategy for optimal flexibility, cost and efficiency
- Resilience to failure, meshing
- Focus on solving domain problems not building infrastructure
- Leverage serverless platforms with simple code to cloud pipelines
- Combine multiple languages and frameworks to build a single solution
Why you shouldn't use microservices
Eventual Consistency
Each service owns it's own database, which requires some data duplication which you don't have in a single normalised database. The benefit of data replication is that services are atomic and easier to scale.
Managing data between services is the hardest challenge in creating an MSA solution
Eventual consistency is a consistency model used in distributed computing to achieve high availability that informally guarantees that, if no new updates are made to a given data item, eventually all accesses to that item will return the last updated value.
- Causal consistency
- Read-your-writes consistency
- Session consistency
- Monotonic read consistency
- Monotonic write consistency
Data storage is cheap compared to delivering actionable insights
Deployment
- High Availability
- Scalability
- Redundancy
Serverless vs Containerised
Architecture
Name | DotNet | Nest.js |
---|---|---|
Swagger | [x] | |
RabbitMQ | x | |
CQRS | [x] | |
CORS | [x] | |
API | Min. Web API | |
DTOs | [x] | |
Automapper | Automapper | |
Repository | [x] | |
Migrations | [x] | |
Entity Model | [x] |
Development Environment
Security
Defence in depth, OWASP top 10
- Encryption
- Network
- Monitoring
- Penetration testing
DotNet Microservices
Legendary effort!
Toolkit
Name | Notes |
---|---|
AKS | |
Helm | |
Dapr | |
Bridge to Kubernetes | |
GitHub Actions | Automate workflows from idea to production |