Messaging Between Microservices

Messaging Between Microservices

When creating microservices, don't forget about the design and movement of your data between the components!

Lorna Mitchell

April 26, 2017

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

21 slides
  1. A swarm of tiny apps talking to the same storage

    is not microservices; it is an HTTP-enabled monolith. @lornajane
  2. Data Hygiene Access to each storage piece should be "owned"

    by one component • decoupling improves scalability • some platforms charge by execution time; don't wait for a network call • improves maintainability - and sanity @lornajane
  3. Start with Security We know how to secure HTTP connections,

    so do it! • Auth standards e.g. JWT • Security in transmission: use HTTPS @lornajane
  4. Consider the Medium Is this a web request, with headers?

    A message on a queue e.g. RabbitMQ or Kafka? @lornajane
  5. Designing Data Formats • JSON or XML? • Binary formats?

    • Apache Thrift • Protocol Buffers • Avro • Data vs MetaData @lornajane
  6. Docs-First API Design • Quick and cheap to produce and

    change • Everyone can participate and discuss • Details (including field names!) are sorted out early Documentation is the first deliverable, and it's a living artefact (keep it in your repo) @lornajane
  7. Components that work alone need excellent log arrangements. It is

    the only way they can communicate with you. @lornajane
  8. Logging and Microservices • Standard, configurable logging setup • Use

    a trace_id to link requests between services • Aggregate logs to a central place, ensure search functionality • Collect metrics (invocations, execution time, error rates) • display metrics on a dashboard • have appropriate, configurable alerting @lornajane
  9. Originator Feedback In a microservices application: • errors can occur

    at any time • the last microservice should send information to the originating application • remember that distributed systems get everything done but not necessarily in the order you expect @lornajane
  10. Data In Microservices • Where does data come from? Where

    does it enter the application? • How does data move safely around the application? • How is data conveyed back out of the application? @lornajane
  11. Resources • Website: https://lornajane.net • Email me: [email protected] Further reading:

    • Designing Data-Intensive Applications By Martin Kleppmann • Production-Ready Microservices By Susan J. Fowler @lornajane

More Decks by Lorna Mitchell

Other Decks in Technology