Skip to content

Commit

Permalink
FIX feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kakabisht committed Dec 2, 2023
1 parent ae07c4a commit 13d0571
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
Eve takes on the role of the problem solver once again and approaches the spaceship. Eve finds Chan, a fellow programming genius from [planet placeholder]. There was a technical glitch in the ship's communication system.

Eve dives into action with her knowledge of Event-driven architecture and AsyncAPI. Eve plans to develop effective communication between the spaceship's components with Chan.

Eve starts by explaining event-driven architecture (EDA) and how to design eda with AsyncAPI to Chan.

## Event-driven architecture

An event is a change in the system's state that triggers an action to communicate between different services. Event driven Architecture(EDA) helps break an app into multiple loosely coupled components that communicate through events. EDA is made up of event producers and consumers:
An event is a change in the system's state that triggers an action to communicate between different services. EDA helps break an app into multiple loosely coupled components communicating through events. EDA is made up of event producers and consumers:

- An event producer detects an event and transmits the event's information to the event consumers through the event channel.
- An event consumer subscribed to an event channel to receive information and process events.

Each component can act as an event producer, consumer, or both, depending on the use case. Let us consider a coffee shop as an example: a customer(consumer) requests an espresso(event), communicating order details to the barista(producer) as a message. The following process happens,
Depending on the use case, each component can act as an event producer, consumer, or both.

Eve then remembers that she didn't offer Chan a beverage. So, she quickly rushes to make a cup of coffee for Chan. While making coffee, Eve considers a coffee shop as an example of an EDA: a customer(consumer) requests an espresso(event), communicating order details to the barista(producer) as a message. The following process happens,

1. The customer orders an espresso(an event), and the order details are told to the barista(a message).
1. The barista then processes the order and starts making an espresso(a response to an event).

So, event-driven architecture in a coffee shop is like the seamless flow of orders and drinks without everything stopping for one specific thing. It keeps things moving smoothly ☕👩‍💻
So, event-driven architecture in a coffee shop is like the seamless flow of orders and drinks without everything stopping for one specific thing. It keeps things moving smoothly.

Chan is now curious about how AsyncAPI can help develop event-driven architecture.

## Event-driven architecture with AsyncAPI

Expand All @@ -22,14 +32,16 @@ They are like digital mailboxes where you can send messages without waiting for

To build an EDA where certain actions(events) trigger other actions, Async API helps map out events and their response. For example, imagine a birthday party with events like cake cutting and gift opening. These events trigger responses, such as singing when the cake is cut or clapping while opening the gifts.

AsyncAPI helps you organize events that will happen, when they will happen, and how everyone should react to them. For example, when the cake is cut, AsyncAPI guides you to sing the birthday song. It also enables creating a party schedule, like cutting the cake at 6 pm and opening gifts at 7 pm.
AsyncAPI helps you organize events that will happen, when they will happen, and how everyone should react to them. For example, when the cake is cut, AsyncAPI guides you in singing the birthday song. It also enables creating a party schedule, like cutting the cake at 6 pm and opening gifts at 7 pm.

Here are reasons why using AsyncAPI enhances EDA design:

- AsyncAPI plans and describes each event and its corresponding reactions across different components.
- AsyncAPI facilitates communication between different components for seamless information exchange.
- AsyncAPI allows components to complete tasks independently without waiting.

Eve further tries to help Chan understand how AsyncAPI can help improve communication between microservices.

## Microservices with AsyncAPI

Each microservice represents a specific function in a microservices architecture, and different microservices communicate using events. For example, one team is responsible for baking the birthday cake, and the other is responsible for decorating the room. These teams need to talk to each other to share their progress.
Expand All @@ -40,4 +52,6 @@ AsyncAPI helps different microservices communicate with each other. For microser
- Schedule when to send these messages
- Ensure consistent language in messages

AsyncAPI ensures that each microservice knows what information it will receive, how it will receive it, and what it should do with it. It also helps document interactions between microservices to help developers understand and integrate them.
AsyncAPI ensures that each microservice knows what information it will receive, how it will receive, and what it should do with it. It also helps document interactions between microservices to help developers understand and integrate them.

Now that Eve and Chan have gotten coffee, they are ready to go inside Chan's spaceship to develop and improve her spaceship's communication system.

0 comments on commit 13d0571

Please sign in to comment.