1 / 38

The Hardest Part of Microservices: Your Data - Christian Posta, Red Hat

Christian Posta, principal architect at Red Hat discusses how to manage your data within a microservices architecture at the 2017 Microservices.com Practitioner Summit.

datawire
Download Presentation

The Hardest Part of Microservices: Your Data - Christian Posta, Red Hat

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Full slide deck here: h"p://bit.ly/ceposta-hardest-part

  2. Christian Posta Principal Architect – Red Hat Twitter: @christianposta Blog: http://blog.christianposta.com Email: christian@redhat.com •  Author “Microservices for Java Developers” •  Committer/contributor Apache Camel, Apache ActiveMQ, Fabric8.io, Apache Kafka, Debezium.io, et. al. •  Worked with large Microservices, web-scale, unicorn company •  Blogger, speaker about DevOps, integration, and microservices

  3. People try to copy Net,lix, but they can only copy what they see. They copy the results, not the process. Adrian Cockcro,, former Chief Cloud Architect, Ne6lix

  4. “Microservices” is about optimizing … for speed.

  5. How does your company go fast?

  6. Manage dependencies.

  7. Wait. What is data?

  8. What is one “thing”?

  9. Title Search Book checkout / purchase Weekly reporBng RecommendaBons

  10. Focus on domain models, not data models •  Break things into smaller, understandable models •  Surround a model and its “context” with an explicit boundary •  Implement the model in code or get a new model •  Explicitly map between different contexts •  Model transactional boundaries as aggregates

  11. SBck with these conveniences as long as you can. Seriously.

  12. But ... •  Load/size is too great to fit on one box •  Modules/use cases have different read/write characterisBcs •  Queries/joins are geOng too complex •  Security issues •  Lots of conflicBng changes to the model/schema •  Need denormalized, opBmized indexing engines •  We want to explicitly reduce dependencies on data between our services

  13. From here on out, what we’re saying is “thank you old work-horse database, we’ve got it from here”…

  14. “A microservice has its own database”

  15. We’re now building a full-fledged data-centric distributed system. Some things to remember…

  16. Plan for failures. Build concepts of Bme, delay, network, and failures into the design as a first-class ciBzen.

  17. h"ps://secure.phabricator.com/book/phabcontrib/arBcle/n_plus_one/ h"ps://secure.phabricator.com/book/phabcontrib/arBcle/n_plus_one/

  18. getBulkHats() getBulkHatsForCatsExcept() wellReallyIJustWantCertainHats() justExecuteThisSqlForMe() h"ps://secure.phabricator.com/book/phabcontrib/arBcle/n_plus_one/

  19. We need “consistency”. But we expect failures. This is starBng to sound like CAP…

  20. Consistency models… •  Strict consistency (Linearizability) •  Sequential consistency •  Causal consistency •  Processor consistency •  PRAM consistency (FIFO) •  Bounded staleness consistency •  Monotonic read consistency •  Monotonic write consistency •  Read your writes consistency •  Eventual consistency h"ps://en.wikipedia.org/wiki/Consistency_model

  21. Replicated Data Consistency Explained through Baseball (Doug Terry) •  What consistency model do you need, depending on what role you’re playing? •  What consistency model are you willing to pay for? •  Official score keeper? (Linearizability or RMW) •  Umpire? (Linearizability) •  Sports writer? (Bounded staleness, Eventual consistency) •  Radio updates? (Monotonic read, Bounded staleness) •  Statistician (Bounded staleness) •  Friends in the pub (Eventual consistency) h"ps://www.microsoa.com/en-us/research/publicaBon/ replicated-data-consistency-explained-through-baseball/

  22. Maybe we can use a relaxed consistency model for some of those previously menBoned use cases… ...and solve for data-sharing issues while taking into account the network and failures.

  23. Example using sequenBal consistency…

  24. What we’ve done is gone off and built a data system at the applicaBon layer.

  25. And this is what the internet companies did also. (some even opensource!!) •  Yelp – MySQL Streamer https://github.com/Yelp/mysql_streamer •  LinkedIn – Databus https://github.com/linkedin/databus •  Zendesk – Maxwell https://github.com/zendesk/maxwell

  26. Meet debezium.io

  27. Meet debezium.io

  28. Thanks for listening! Time for demo? Twitter: @christianposta Blog: http://blog.christianposta.com Email: christian@redhat.com Full slide deck here: h"p://bit.ly/ceposta-hardest-part

More Related