Skip to content

Latest commit

 

History

History
76 lines (57 loc) · 2.27 KB

README.md

File metadata and controls

76 lines (57 loc) · 2.27 KB

Asynchronous Processing

Backend Challenge BTG Pactual (07/2024)


Architecture:

Software Architecture

Relational Data Modeling - Customer Service:

Software Architecture

Relational Data Modeling - Orders Service:

Software Architecture

Request: /create/customer

{
    "email": "lorem@ipsum.br",
    "username": "lorem ipsum"
}

Request: /create/product

{
    "name": "product_name"
    "value": 3150,
}

Request: /create/order

{
    "email": "lorem@ipsum.br",
    "products": [
        {
            "name": "product_1",
            "quantity": 2
        },
        {
            "name": "product_2",
            "quantity": 1
        },
        {
            "name": "product_3",
            "quantity": 7
        }
    ]
}

Details:

1.0: "Customers" Service

    - 1.1: Assigned for creating products, customers, and customer orders.

    - 1.2: Order data is stored in PostgreSQL, and then the information is sent via messaging (RabbitMQ exchange) to the "orders" service.

2.0: "Orders" Service.

    - 2.1: Assigned for consuming the message sent by the "customers" service.

    - 2.2: Data stored in memory (Redis) has a TTL.

    - 2.3: Information about orders and messages consumed within a month are persisted to disk.

3.0: The services also communicate via HTTP requests.

    - 3.1: CORS prevents the client from directly accessing the "orders" service.

LinkedIn and Gmail

LinkedIn Gmail