BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage Podcasts Chris Richardson on Domain-Driven Microservices Design

Chris Richardson on Domain-Driven Microservices Design

Bookmarks

In this week’s podcast, Thomas Betts talks with Chris Richardson, a developer, architect, Java Champion and author of POJOs in Action. Before his workshop on Microservices w/ Spring Boot and Docker at QCon San Francisco 2016, Richardson took time to discuss his ideas on how to use DDD and CQRS concepts as a guide for implementing a robust microservices architecture. You can also watch his  related presentation “Developing Microservices with Aggregates”.

Key Takeaways

Show Notes

Microservices vs. Microservices Architecture

  • 1m:50s - @crichardson tweet: "Microservice architecture" is a better term than "microservices". The latter suggests that a single microservice is somehow interesting.

System Decomposition Following Domain-Driven Design

  • 4m:16s - Decomposing a system into a set of microservices is related to understanding business capability and subdomain.
  • 5m:16s - If you decompose your system in the wrong way, you’re making a mistake at an architectural level. The worst case is a distributed monolith.
  • 6m:34s - In DDD terms, each service is itself a bounded context, with its own domain model and ubiquitous language.
  • 8m:33s - The “fuzzy stuff” in the DDD book, such as bounded contexts, directly apply to a microservices architecture.
  • 10m:26s - One DDD constraint is that a transaction can only create or update a single aggregate. In practice, this means microservice architectures cannot have distributed transactions.
  • 11m:13s - If you want to do microservices properly, read the DDD book.

Microservice Boundaries, EDA and CQRS

  • 11m:51s - Microservices must be loosely coupled, usually creating a model with one database per service.
  • 12m:45s - There is a business requirement to maintain data consistency across services, and using an event driven architecture is a good way to achieve that.
  • 13m:38s - Event sourcing is specific technique for persisting domain objects as a series of events.
  • 14m:11s - Just as transactions don’t like to be split across microservices, queries cannot simply join across multiple data sources. CQRS provides a solution that accommodates querying via microservices and materialized views.

Replacing a Monolith

  • 17m:27s - Microservices are not a silver bullet, nor a free lunch. MSA comes with complexity, ranging from data management to deployment.
  • 20m:00s - When does it make sense to make the transition from a monolith to an MSA?
  • 20m:35s - MSA is a solution to a problem. With an existing monolith, if are you unhappy with the rate of development, or the pain associated with making changes, then microservices are probably the solution.
  • 22m:29s - When moving to microservices, definitely do not do a big bang rewrite -- take an iterative approach, incrementally refactoring your monolith into a set of services.
  • 24m:16s - Implementing microservices can utilize new, cool technology, but always remember the purpose of writing an application is to automate critical business processes. Domain-Driven Design can help develop the business logic at the core of your system.

Technology Concepts Discussed

Books Mentioned

More about our podcasts

You can keep up-to-date with the podcasts via our RSS Feed, and they are available via SoundCloud, Apple Podcasts, Spotify, Overcast and the Google Podcast. From this page you also have access to our recorded show notes. They all have clickable links that will take you directly to that part of the audio.

Previous podcasts

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT