Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

datawire
February 09, 2017

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

February 09, 2017
Tweet

More Decks by datawire

Other Decks in Technology

Transcript

  1. Twitter: @christianposta Blog: http://blog.christianposta.com Email: [email protected] Christian Posta Principal Architect

    – Red Hat •  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
  2. 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
  3. 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
  4. 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
  5. From here on out, what we’re saying is “thank you

    old work-horse database, we’ve got it from here”…
  6. Plan for failures. Build concepts of Bme, delay, network, and

    failures into the design as a first-class ciBzen.
  7. Consistency models… h"ps://en.wikipedia.org/wiki/Consistency_model •  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
  8. Replicated Data Consistency Explained through Baseball (Doug Terry) h"ps://www.microsoa.com/en-us/research/publicaBon/ replicated-data-consistency-explained-through-baseball/

    •  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)
  9. 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.
  10. What we’ve done is gone off and built a data

    system at the applicaBon layer.
  11. 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