Go

Microservices

Service architecture, discovery, communication, API gateway, circuit breaker, observability, structured logging, metrics, distributed tracing

24 câu hỏi phỏng vấn·
Senior
1

What is the main difference between monolithic and microservices architecture?

Câu trả lời

In microservices architecture, the application is decomposed into independent services that can be developed, deployed and scaled separately, unlike monoliths where all code is in a single process. Each microservice has its own database and communicates via APIs. This enables better scalability, resilience and technology flexibility, but introduces increased operational complexity.

2

What is the main role of service discovery in microservices architecture?

Câu trả lời

Service discovery enables services to locate each other dynamically without hardcoded configuration. Services register with a registry (Consul, etcd, Eureka) with their IP address and port. Clients query the registry to get available instances. This facilitates horizontal scaling, continuous deployment and resilience in case of instance failure.

3

In microservices architecture, which pattern manages distributed data consistency without ACID transactions?

Câu trả lời

The Saga pattern manages distributed data consistency via a sequence of local transactions. Each service executes its transaction and publishes an event. If a step fails, compensating transactions undo previous changes. Implementations can be orchestrated (central coordinator) or choreographed (pub/sub events). This guarantees eventual consistency without distributed locks.

4

Which Go library is commonly used to implement service discovery with Consul?

5

What is the main difference between synchronous (REST/gRPC) and asynchronous (messaging) communication between microservices?

+21 câu hỏi phỏng vấn

Nắm vững Go cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí