4. What are we trying to achieve?
• Accelerate teams
• Reduce dependency nightmares
• Increase application throughput
Calvin and Hobbes, Bill Waterston
6. We want isolation
• At the API
• In our source
• For our data
Wikipedia, Creative Commons, created by DFoerster
7. We want realistic data management
• Transactions, especially distributed, will not work
• Consistency is an anti-pattern at scale
• CQRS and Event Sourcing, not CRUD
• Distributed locks and shared data will limit you
Think in terms of compensation, not prevention.
Kevin Webber, Lightbend
8. We want asynchronous APIs
• Synchronous request/response semantics are expensive
• Use REST for external APIs
• Stream-based interactions for inter-service communication
US Postal Service
9. We want immutable deployments
• We can bind a build of our application to a version of our
configuration and always know what is currently running
• You cannot edit configuration and keep running
Dilbert, Scott Adams
10. We want to expose a “tip of the iceberg”
• Users see the public API
• The API hides much complexity
MyBluePuzzle.org
11. We want DDD (but not a requirement)
• Solving your pain is
• In a greenfield project, Bounded Contexts and Aggregate
Roots can help you to decompose the problem
12. We want to ACID v2
• Associativity and Commutativity are the path to scale
• Idempotent and Distributed
Wikipedia, Creative Commons, created by Weston.pace
13. We will have additional operational complexity
• Proxying
• Service Discovery
• Stateless aggregation
• Orchestration
• Failure management
• Versioning
Complexityandotherbeasts.com
14.
15. • Service API
• Persistence API
• Development environment
• Production environment
Lagom
16. • IO and communication
• Streaming between services as a first-class concept
• Higher level of resilience and scalability with no blocking
• Service is a Bounded Context in DDD
Lagom Service API
17. • Event sourced (deltas) with Cassandra backend by default
• No object/relational impedance mismatch
• Can always replay to determine current state
• Allows you to learn more from your data later
• Persistent entity is an Aggregate Root in DDD
• Can be overridden for CRUD if you want
Lagom Persistence API
18. • Create single project definition in sbt, use runAll, includes:
• In-memory Cassandra with own keyspaces
• A service locator
• A service gateway
• Overload Mode: recompile and redeploy on save
Development Environment
19. • Deployment
• Monitoring
• Scaling
• Can test locally with ConductR then push to production
• Launch multiple instances with a single command
Production Environment (Lightbend RP)