Talking to Microservices.

Luis Hernandez

Software Developer

lhernandez@nearsoft.com

Microservices

Architecture.

It comes when an application is broken down into smaller, composable pieces which work together.

Microservices are a contrast to a traditional, "monolithic" application which is all developed all in one piece.

Shopping Application

Account Service

Order Service

Inventory Service

...

Inter-Service Communication

User Service

Order Service

Inventory Service

Communication Types

Synchronous 

Asynchronous

Synchronous 

Order

Service

Inventory

Service

 POST /selectItem

200

Purchase Item Process

Select Item

Retrieve Availability

Finish Purchase

Asynchronous

Communication

Services communicate through messages.

 

Everything happens service-service

Buzzwords

Messages

Message Broker

Channels

Publisher

Subscriber

Topics

 Queues

Pub/Sub 101

Message Broker

Channel

Publisher

Subscriber

Subscriber

Pub/Sub 101

Services

Message Broker

Messages

Channels

Pub/Sub 101

Order

Service

Inventory

Service

   itemSelected

Select Item

Retrieve Availability

Finish Purchase

Purchase Item Process

Select Other item

View shopping Cart

Message Broker

confirmedItem

   itemSelected

confirmedItem

Event-Driven Microservices

Mail

Service

Order

Service

Inventory

Service

User

Service

Message Broker

purchaseFinished

itemSelected

Login

Logging

Service

purchaseFinished

Apache Kafka

An example of a message broker.

Kafka is a distributed publish-subscribe messaging system that is designed to be fast, scalable, and durable.

Kafka + Zookeper

Subscriber

Subscriber

Publisher

Zookeeper

Kafka Broker

Kafka Broker

Thanks

Talking to Microservices.

By Luis Hernandez

Talking to Microservices.

  • 742