Messaging architecture

Message formats:

  • Text, such as JSON/XML. Readable & easier for debugging.
  • Binary. Eg: Protocol buffers (with self-defined tagged fields), Avro (requiring consumer to know the schema) & Thrift.

Message protocols:

  • http. Eg: REST, SOAP. REST requires mapping calls to REST verbs.
  • IPC, such as gRPC, a client-server framework using binary Protocol buffers.

Service discovery:

  • Self registration with a service registry.
  • Client service discovery. eg: Netflix Eureka: a HA service registry, Eureka client & Ribbon, a http client. Pivotal Spring Cloud, a Spring Java client that works with Eureka.

Message types:

  • Document
  • Command
  • Event

Message channels:

  • Point-to-Point channel: 1-1 interaction.
  • Pub-Sub (Publish-Subscribe): 1:many interactions.

Message notifications:

  • One-way notification: no reply required.
  • Pub-Sub: Async responses.

Message broker?

  • Brokerless messaging: Peer-to-peer (P2P) like ZeroMQ. Simple, performant, guaranteed delivery complex, reduced availability.
  • Message broker: Helps two services communicate. Popular.

Message broker:

  • Standards: AMQP, STOMP.
  • Open source: ActiveMQ (queues/topics), RabbitMQ (exchanges/queues), Apache Kafka (Topics).
  • Cloud: AWS Kinesis (streams), AWS SQS (queues). Uses sharding to improve availability.

Database for idempotency:

Another abstraction layer. Choose a database & store unique messages based off an id (say message id) to implement idempotency. Push to message broker from db.

  • Debezium / Eventuate Tram: Db to Kafka.
  • LinkedIn Databus: Oracle transaction log published as events.
  • DynamoDB streams: Time-ordered DynamoDB log & publish as events.

Source: Microservices Patterns by Chris Richardson


要查看或添加评论,请登录

Swaminathan Saikumar的更多文章

  • Why is Go fast?

    Why is Go fast?

    Why is Go fast? Go has become popular for microprocesses & for scaling. What are the design decisions that make Go…

  • Cloud native architecture-an overview

    Cloud native architecture-an overview

    Any infrastructure has two main components: compute & storage. Software needs compute to run & storage to read/write.

  • I Bonds during high inflation

    I Bonds during high inflation

    During times of high inflation in the USA, consider the Series I Bonds issued by the US treasury. Currently, I bonds…

  • Microservices deployment

    Microservices deployment

    History of deployment options: Physical machines: 1990s. Fast deployment, best performance.

  • Microservices security & tracking

    Microservices security & tracking

    Security: AAA: Authentication, Authorization, Accounting/Auditing Secure interprocess communication (TLS) Security…

    1 条评论
  • Isolation & Locks

    Isolation & Locks

    The CAP theorem states that two out three of Consistency, Availability & Partition Tolerance may be achieved. RDBMS…

  • Microservices API Gateway

    Microservices API Gateway

    Benefits: Instead of specific services, clients talk to the API gateway, which provides a client-specific API…

  • SQL, NoSQL or Hadoop for 'Big Data'?

    SQL, NoSQL or Hadoop for 'Big Data'?

    In an earlier post, we had looked at how to use the 3Vs (Volume, Velocity & Variety) of data & the CAP theorem…

  • Choose relational vs NoSQL database?

    Choose relational vs NoSQL database?

    Relational or NoSQL? You have this great software application in mind. Now, to implement it, what database should you…

  • Scaling applications-an overview

    Scaling applications-an overview

    As a business grows, its software applications will need to scale. Computing bottleneck Run multiple identical…

社区洞察

其他会员也浏览了