backend / README.md

Microservices Architecture

1 min read index source

Microservices Architecture

Microservices is an architectural style that structures an application as a collection of loosely coupled, independently deployable services.

Key Concepts

Architecture Principles

  • Single Responsibility: Each service has one business capability
  • Independence: Services can be developed, deployed, and scaled independently
  • Decentralization: Each service manages its own data
  • Fault Isolation: Failure in one service doesn’t affect others

Communication Patterns

  • Synchronous: HTTP/REST, gRPC
  • Asynchronous: Message queues, event-driven
  • Service Discovery: Dynamic service location
  • API Gateway: Single entry point for clients

Data Management

  • Database per Service: Each service owns its data
  • Event Sourcing: Store events instead of state
  • CQRS: Separate read and write models
  • Saga Pattern: Distributed transaction management

Common Interview Questions

  1. What are the advantages and disadvantages of microservices?
  2. How does microservices differ from monolithic architecture?
  3. Explain service discovery and its importance
  4. How to handle distributed transactions in microservices?
  5. What is the API Gateway pattern?
  6. How to implement inter-service communication?
  7. Explain the concept of circuit breakers
  8. How to handle data consistency across services?
  9. What are the different deployment strategies?
  10. How to implement monitoring and observability?
  11. Explain the concept of service mesh
  12. How to handle authentication and authorization?
  13. What are the challenges of microservices testing?
  14. How to implement event-driven architecture?