Advantages of microservices

  • develop different microservices with different technologies/languages
  • testing and deploying is much faster, for small changes it is easy to test and deploy the individual microservices as opposed to monolith.

Disadvantages of microservices

  • developing features require coordination between teams, if feature A needs to be completed by both team1 and team2 then they need to coordinate. teams might need to use feature flags which basically says that the feature will be activated when the other team also completes it. they need to deploy together in order to make feature A work
  • deployment is more complex
  • monitoring is more complex
  • managing product release is more complex

When suited best

  • you have large application with multiple themes working on it
  • you need scaling of applications, especially the portions of application to scale up and down quickly

Common types of tests

  • unit testing
  • integration testing
  • acceptance testing
  • contract testing
  • end to end microservice testing: validates every process in the workflow is functioning correctly. it also ensures that the system works together as a whole

What is CDC?

  • Consumer Driven Contract

Service Architecture

FeatureMonolithicSOA (Service-Oriented Architecture)Microservices
StructureSingle unified codebaseMultiple services communicating over ESB or HTTPIndependently deployable small services
DeploymentDeployed as a single unit
Deployment takes
time
Deployed as semi-independent servicesEach service deployed independently
CommunicationIn-process callsOften via ESB (Enterprise Service Bus)Lightweight protocols (HTTP/REST, gRPC, etc.)
ScalabilityScales as a wholeServices can scale individually to some extentFine-grained, independent scalability
Tech Stack FlexibilityLimited to one tech stackModerate flexibilityHigh flexibility per service
Fault IsolationLow—failure can impact entire systemBetter than monolith but still has shared dependenciesHigh—failures contained to individual services
Speed of DevelopmentFast initially, slows over timeSlower than monolith, faster than microservicesFast for small teams, complex coordination needed
ComplexitySimple at first, becomes harder to manageRequires governance and central coordinationComplex, requires DevOps and monitoring
Best ForSmall teams, MVPs, early-stage productsMedium-large enterprises with reusable service layersLarge-scale systems with independent modules

Cloud Native Architecture

  • 12 factor
  • 15 factor

Domain based microservices