Microservices & Messaging Flashcards

1
Q

What are the key benefits of using microservices architecture?

A

Microservices offer modularity, enabling independent development, deployment, and scaling of individual services. This allows for better fault isolation, flexibility in technology choices, and enhanced scalability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you handle communication between microservices?

A

Microservices can communicate through synchronous (HTTP/REST APIs, gRPC) or asynchronous methods (message brokers like RabbitMQ, Kafka). For decoupling and fault tolerance, asynchronous messaging is preferred in many systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some common challenges with microservices, and how do you address them?

A

Common challenges include:
Data consistency: Solved using distributed patterns like the Saga or Event Sourcing.
Service discovery: Solved using tools like Consul or Kubernetes for registering and finding services.
Network latency: Minimized by reducing inter-service calls or using caching.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does the Saga Pattern work, and why is it important in microservices?

A

The Saga Pattern manages distributed transactions in microservices. It divides a long transaction into smaller steps, with compensating transactions if one step fails. This ensures consistency across multiple services without using a traditional two-phase commit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you monitor and maintain the health of your microservices?

A

Monitoring tools like Prometheus, Grafana, or ELK stack (Elasticsearch, Logstash, Kibana) are used to monitor service performance, logs, and health checks. Implementing endpoint checks (e.g., /health) for each service is also common.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly