μServices + CQRS

Pros

  • Easy to develop
  • Simple to test
  • Simple to deploy
  • Low resources mem/cpu needs

Cons

 

  • Monoliths don’t have the capacity to handle the complexity of larger applications
  • Scaling can be an issue
  • Smallest change requires entire system be rebuilt and redeployed

Monolith

Pros

  • Small and focused on a specific feature
  • Independent deployment
  • Scalability is easier
  • Can be developed independently by small team
  • Different language, framework
  • Autonomous

Cons

 

  • More discussion soon...

Microservice

CQRS + EventSourcing + μServices

Skype analogy

  • User - μServices
  • Private message - command
  • Chat message - event
  • Chat - event stream (write db), enterprise service bus

Example

  • we have Receptionist, Librarian users in a chat
  • visitors go to library to get some books (chat messages run)
  • Reminder user is added to the chat (read history, make notes)
  • Reminder send private message to Librarian to ban some visitors
  • new rules for Remider user: make newsletter for top 10 visitors (read history again)

Don't use μServices unless you have to

  • μServices inside monolith at start
  • Once you cross process boundary you will get overhead:
    • Serialization cost
    • Request delivery cost
    • Failure (network, app)
    • Version inconsistency (previous version support)
    • No .net infrastructure, examples

Questions

μServices + CQRS (rev 2)

By Vladimir Gaevoy

μServices + CQRS (rev 2)

  • 1,732