soa to microservices
TRANSCRIPT
SOA to Microservices
@christianposta Principal Architect at Red Hat 6/30/16
Modernization with microservices and containers
Christian Posta Principal Middleware Architect @ Red Hat
Twitter: @christianposta
Blog: http://blog.christianposta.com
Email: [email protected]
• “Microservices for Java developers” (6/2016)
• Committer Apache Camel, ActiveMQ, Fabric8, others
• Worked with large Microservices, web-scale, unicorn company
• Blogger, speaker about DevOps, integration, and microservices
Increased Interoperability
Increased Vendor and Technology Diversity
Increased Federation
Increased Organizational Agility
• Single, self-contained, autonomous
• Isolated and Resilient to faults • Faster software delivery • Own their own data • Easier to understand individually • Scalability • Right technology for the
problem • Test individual services • Individual deployments
Microservices to the rescue…
Infrastructure for scale
Organizational structure
Identify a useful domain model with boundaries
Microservices: Challenges for Enterprises
PeopletrytocopyNet,lix,buttheycanonlycopywhattheysee.Theycopytheresults,nottheprocess.
Adrian Cockcroft, former Chief Cloud Architect, Netflix
Domain Complexity • Break things into smaller,
understandable models • Surround a model and its
“context” with a boundary • Implement the model in code
or get a new model • Explicitly map between
different contexts • Model transactional
boundaries as aggregates
Domain Aggregate
• Design for consistency boundaries, not data model composition
• Single transaction per aggregate
• Based on business invariants • Eventual consistency between
aggregates
Embrace Autonomy! No Two-Phase Commit!
• Always use idempotent consumers
• Relax foreign key constraints between aggregates/bounded contexts
• Embrace eventual consistency between time domains
• Self service
• Built in deployments
• Cluster logging, metrics, monitoring
• Blue/Green deployments, Canary deployments
• Service Discovery built in
• Continuous Integration / Continuous Delivery
Platform automation
• Circuit breakers/bulkhead
• Client-side load balancing
• Forward proxying
• Service routing
• Centralized configuration management
• Leadership election
Microservices libraries/frameworks
• Load balancing built-in
• Service discovery built-in
• Self healing built-in
• No complicated service-discovery infrastructure!
• Just use DNS for the 95% use case
• Save client-side load balancing for the 5% use case
Kubernetes Services
• WildFly Swarm (wildfly-swarm.io)
• Kubernetes / OpenShift (openshift.org)
• Apache Kafka (kafka.apache.org)
• Debezium (debezium.io)
• Apache Camel (camel.apache.org)
• Spring Boot (projects.spring.io/spring-boot/)
• Liquibase (liquibase.org)
Technologies used
https://github.com/christian-posta/ticket-monster-admin https://github.com/christian-posta/ticket-monster-orders https://github.com/christian-posta/ticket-monster-search
https://github.com/christian-posta/ticket-monster-infra https://github.com/christian-posta/ticket-monster-admin-camel https://github.com/christian-posta/ticket-monster-orders-camel
• Better, richer, aggregate design
• CQRS for the orders bounded context
• Security with Keycloak
• Tracing with Zipkin
• Sidecar circuit breakers with Netflix OSS Hystrix
• CI / CD with Fabric8 / OpenShift
Left todo
Christian Posta Principal Middleware Architect @ Red Hat
Twitter: @christianposta
Blog: http://blog.christianposta.com
Email: [email protected]