Upload
javier-ferrer-gonzalez
View
1.499
Download
0
Embed Size (px)
Citation preview
Leaving The Monolith thanks to Event SourcingMigrations, Event Sourcing, AWS, and other things of the meter
@JavierCane#scpna - Software Craftsmanship Pamplona
@JavierCane#scpna - Software Craftsmanship Pamplona
Saliendo del monolito, al Rico EventitoMigraciones, Event Sourcing, y otras cosas del meter
Welcome!I’m Javier Ferrer González
@JavierCane
Greetings to Sergi!@SergiGP
Welcome!
Contents
! Starting point ! Needs ! Action plan ! Flow example ! Conclusions
1. Starting point
Context
Starting point Context
! Mobile first application ! Crazy growth (ads in TV in USA and Turkey)
◕ External services (Parse, Kahuna…)
◕ In-house API ! Where do we go
◕ Microservices architecture
◕ Event Sourcing
◕ Orchestration Layer
2. Needs
New chat system!
Needs New chat system!
! From:
◕ REST API
◕ “Chat” (messaging system) ! To:
◕ WebSockets (better UX)
◕ Chat
◕ Isolated from API service
◕ Backwards Compatible (mobile!)
◕ Scale!
3. Action plan
Maintaining Backwards Compatibility (BC)
Action plan Maintaining BC
! Develop new chat with Scala and Akka, and WS ! Maintain BC taking advantage of Event Sourcing
Action plan Maintaining BC
Action plan Maintaining BC
Action plan Maintaining BC
! Why not sync through DB?
◕ Share DB: K.A.O.S.
◕ Doesn’t scale
◕ Coupling
Action plan Maintaining BC
Action plan Maintaining BC
! Why not sync through SQS?
◕ Doesn’t scale
Action plan Maintaining BC
Action plan Maintaining BC
! Why?
◕ Scale
◕ Decoupled
◕ Open-Closed Principle compliant at a services level
4. Flow example
Maintaining BC
From the new chat to the legacy one
Flow example Maintaining BC
From the legacy chat to the new one
Flow example Maintaining BC
5. Conclusions
Conclusions
! Event Sourcing ~~ DIP at a services level
◕ Dependency Inversion Principle (CodelyTV video)
◕ Allow OCP: One SNS publishes to many SQS
◕ Encourage SRP
◕ Decoupleeeeee
Conclusions
Conclusions
! Isolated services
◕ Different technologies
◕ Different context
◕ Change context => Mental challenge ! AWS vs RabbitMQ
◕ Go fast => AWS
! From PHP to Scala: 🙃 🙂 🙃 💃 🙃 😀 😐 😳 🤔 🙂 🙃 🙂 …
! Know more at #SCBCN16! (October 1st & 2nd in BCN)
References / To take away
! A Series of Fortunate Events ! The anatomy of Domain Event ! 6 Code Smells with your CQRS Events and How to
Avoid Them ! json:api standard ! Sending Amazon SNS Messages to Amazon SQS
Queues ! Subscribing a Queue to an Amazon SNS Topic
Questions?
Thanks!Contact @JavierCane || @SergiGP [email protected] Codely.TV
Credits
! Presentation base template by SlidesCarnival ! Graphics generated using draw.io