Tell us about microservices vs monolith, principles of microservices interaction. Are you familiar with orchestration and choreography?
sobes.tech AI
Answer from AI
Monolith — is an architecture where all components of the application are tightly coupled and work as a single unit. Advantages: easier to develop and deploy in the initial stages. Disadvantages: more difficult to scale and maintain as it grows.
Microservices — is a set of independent services, each responsible for its own business function. They interact through well-defined APIs, usually via HTTP/REST, gRPC, or message brokers (e.g., Kafka).
Principles of microservice interaction:
- Clearly defined API contracts
- Asynchronous interaction through events or messages to reduce coupling
- Error handling and retries
Orchestration — centralized management of processes and interactions between microservices. For example, one service controls the sequence of calls to others.
Choreography — decentralized interaction, where each service reacts to events and independently makes decisions about further actions, without a central controller.
Both approaches have their pros and cons and are chosen depending on system requirements.