Diseño y desarrollo basada en arquitectura reactiva 🤓

El problema 😬


THE MONOLITH
📱GET /users/x
DB
PUT /orders/x 💻
{
id: "user_id",
name: "Juan Perez",
total_orders_created: 1
}x1000
🔥
😰

THE MONOLITH
📱GET /users/x
DB
PUT /orders/x 💻

USERS SERVICE
📱GET /users/x
DB
PUT /orders/x 💻
ORDERS SERVICE
x1000
🔥
😰

USERS SERVICE
📱GET /users/x
PUT /orders/x 💻
ORDERS SERVICE
DB
DB
x1000
🔥
😁
🏖
{
id: "user_id",
name: "Juan Perez",
total_orders_created: 1
}
USERS SERVICE
📱GET /users/x
PUT /orders/x 💻
ORDERS SERVICE
DB
DB
GET /orders
?user_id=x
x1000
🏖
🔥
😰
Y cómo lo solucionamos 🤔

Event-Driven Architecture

USERS SERVICE
📱GET /users/x
PUT /orders/x 💻
ORDERS SERVICE
DB
DB
Publishes
order_created
Suscribed to
😁
x1000
🏖
🔥
{
id: "user_id",
name: "Juan Perez",
total_orders_created: 1
}Arquitectura reactiva y desechable 😎

sistemas individuales colaboran como una unidad, respondiendo ante un estímulos

Manifiesto Reactivo 📃
- Responsivo: detectar y gestionar rapidamente
- Resilente: recuperarse aun cuando hay fallos
- Elástico: Adaptarse dinámicamente a la carga
- Orientado a mensajes: comunicarse asíncronamente mediante mensaje o eventos

Manifiesto Reactivo 📃

responsivo, resilente, elástico, orientado a mensajes
Streaming data pipeline


{
"products": [{
"sku": "020301",
"name": "Palta",
"price": 2990
}],
}/post product
{
"products": [{
"sku": "020301",
"name": "Palta",
"price": 2990,
"stock": 10
}],
}1
{
"products": [{
"sku": "020301",
"name": "Palta",
"price": 2990,
"stock": 10,
"image": https://www.test.com/tests/assets/img/palta.jpg
}],
}2
3
?

1
Channel: product.inserted
2
Channel: product.with_stock
Channel: product.with_image
DEMO

Arquitectura reactiva
By Amaru Ugaz
Arquitectura reactiva
- 58