Sobes.tech
Senior

How was the server/service architecture arranged?

sobes.tech AI

Answer from AI

The server architecture was built on a microservices principle using Python and the FastAPI framework to create RESTful APIs. Each service was responsible for a specific business logic and interacted with others via HTTP or message queues (RabbitMQ).

Main components:

  • API Gateway, which routed requests and provided authentication.
  • Microservices implementing specific functions (e.g., user management, order processing).
  • PostgreSQL database for storing core information.
  • Caching with Redis to speed up access to frequently requested data.

This approach ensured scalability, simplified maintenance, and allowed independent development of different parts of the system.

Example of a simple microservice on FastAPI:

from fastapi import FastAPI

app = FastAPI()

@app.get("/items/{item_id}")
async def read_item(item_id: int):
    return {"item_id": item_id, "name": f"Item {item_id}"}