Microservices Architecture Interview Questions & Answers | .NET Core | Azure | Docker | Kubernetes | Service Bus | Kafka | CQRS | Saga
Microservices Architecture అనేది modern enterprise applicationsలో ఎక్కువగా ఉపయోగిస్తున్న software architecture approach. ముఖ్యంగా ASP.NET Core, Azure, Docker, Kubernetes, API Management, Azure Service Bus, Kafka, CQRS, Saga Pattern వంటి technologiesతో పనిచేసే .NET Developers మరియు Architectsకి Microservices interview questions చాలా ముఖ్యమైనవి.
ఈ articleలో Basic నుంచి Advanced level వరకు Top 100 Microservices Interview Questions and Answers in Telugu practical examplesతో చూద్దాం.
Part 1: Microservices Basics
1. Microservices అంటే ఏమిటి?
Microservices అనేది ఒక పెద్ద applicationను చిన్న చిన్న independently deployable servicesగా విభజించే architectural approach.
ప్రతి service ఒక specific business capabilityని handle చేస్తుంది.
ఉదాహరణ:
E-Commerce Application
├── Customer Service
├── Product Service
├── Order Service
├── Payment Service
├── Inventory Service
└── Notification Service
ప్రతి service independently develop, deploy మరియు scale చేయవచ్చు.
2. Monolithic Architecture అంటే ఏమిటి?
Monolithic architectureలో application మొత్తం ఒకే deployable applicationగా ఉంటుంది.
E-Commerce Application
|
---------------------------------------
| | | |
Customer Product Order Payment
ఒక చిన్న change చేసినా మొత్తం applicationను deploy చేయాల్సి రావచ్చు.
3. Monolithic మరియు Microservices మధ్య తేడా ఏమిటి?
| Monolithic | Microservices |
|---|---|
| Single application | Multiple services |
| Usually single deployment | Independent deployments |
| Scaling మొత్తం applicationకు | Individual service scaling |
| Large codebase | Smaller codebases |
| Failure impact ఎక్కువ | Failure isolation సాధ్యం |
| Technology flexibility తక్కువ | Polyglot possible |
4. Microservices యొక్క ముఖ్యమైన characteristics ఏమిటి?
ముఖ్యమైన characteristics:
- Independent deployment
- Loose coupling
- High cohesion
- Business capability based services
- Independent scalability
- Fault isolation
- Decentralized data management
- API/Event based communication
5. Microservice మరియు API మధ్య తేడా ఏమిటి?
Microservice ఒక business capabilityని implement చేసే service.
API ఆ serviceతో communicate చేయడానికి ఉపయోగించే interface.
ఉదాహరణ:
Order Microservice
|
+---- REST API
|
+---- GET /api/orders
|
+---- POST /api/orders
API ఒక microserviceలో భాగం కావచ్చు కానీ API = Microservice కాదు.
6. ఒక Microserviceలో ఒక database ఉండాలా?
Recommended approach:
Database per Service
ఉదాహరణ:
Order Service → Order DB
Payment Service → Payment DB
Inventory Service → Inventory DB
Customer Service → Customer DB
దీనివల్ల services database-level coupling నుంచి బయటపడతాయి.
7. Microservicesలో database share చేయవచ్చా?
Technically సాధ్యమే.
కానీ production architectureలో shared database సాధారణంగా avoid చేయడం మంచిది.
ఎందుకంటే:
Service A
|
+------ Shared DB ------+
|
Service B ------------------+
ఇది services మధ్య strong couplingను create చేస్తుంది.
8. Microservices ఎందుకు ఉపయోగించాలి?
ముఖ్యమైన కారణాలు:
- Independent deployment
- Scalability
- Fault isolation
- Faster development
- Team autonomy
- Technology flexibility
- Independent releases
9. Microservices వల్ల disadvantages ఏమిటి?
Microservices అన్ని applicationsకి సరైన solution కాదు.
Disadvantages:
- Distributed system complexity
- Network failures
- Data consistency challenges
- Monitoring complexity
- Deployment complexity
- Debugging difficult
- Infrastructure cost
- Distributed transactions
10. ఎప్పుడు Microservices ఉపయోగించకూడదు?
Application చిన్నదిగా ఉంటే మరియు:
- Small team
- Simple business logic
- Low scalability requirements
- Low deployment complexity
ఉంటే Monolithic architecture సరిపోవచ్చు.
Part 2: Microservices Design
11. Microservice boundary ఎలా define చేస్తారు?
Business capability ఆధారంగా service boundaries define చేయాలి.
ఉదాహరణ:
E-Commerce
Customer
Order
Payment
Inventory
Shipping
Notification
Database tables ఆధారంగా blindly services create చేయకూడదు.
12. Bounded Context అంటే ఏమిటి?
DDDలో Bounded Context అనేది specific business domainకి సంబంధించిన boundary.
ఉదాహరణ:
Sales Context
|
+-- Order
+-- Customer
Payment Context
|
+-- Payment
+-- Transaction
ఒక contextలోని terminology మరియు rules మరొక contextతో తప్పనిసరిగా same ఉండాల్సిన అవసరం లేదు.
13. High Cohesion అంటే ఏమిటి?
ఒక serviceలో logically related functionality మాత్రమే ఉండటం High Cohesion.
ఉదాహరణ:
Payment Service
Create Payment
Refund Payment
Get Payment Status
Validate Payment
ఇవి ఒకే business capabilityకి సంబంధించినవి.
14. Loose Coupling అంటే ఏమిటి?
Services ఒకదానిపై మరొకటి minimum dependency కలిగి ఉండటం Loose Coupling.
Bad:
Order → Payment → Inventory → Customer → Notification
Better:
Order
|
+---- Event ----> Payment
|
+---- Event ----> Inventory
|
+---- Event ----> Notification
15. Microservicesలో synchronous communication అంటే ఏమిటి?
ఒక service మరో serviceకి request పంపి response కోసం wait చేస్తే synchronous communication.
ఉదాహరణ:
Order Service
|
| HTTP Request
↓
Payment Service
|
| Response
↓
Order Service
REST/HTTP సాధారణ example.
16. Asynchronous communication అంటే ఏమిటి?
Sender message పంపిన తర్వాత immediate response కోసం wait చేయకుండా continue అయితే asynchronous communication.
ఉదాహరణ:
Order Service
|
| OrderCreated Event
↓
Azure Service Bus
|
+----> Payment Service
|
+----> Inventory Service
|
+----> Notification Service
17. REST vs Messaging – ఏది ఎప్పుడు ఉపయోగించాలి?
REST:
- Immediate response అవసరమైనప్పుడు
- Query operations
- Simple request/response
Messaging:
- Event-driven workflows
- Loose coupling
- Background processing
- Retry అవసరమైనప్పుడు
- Multiple consumers ఉన్నప్పుడు
18. Event-Driven Architecture అంటే ఏమిటి?
ఒక service business event publish చేస్తుంది. ఇతర services ఆ eventను consume చేస్తాయి.
ఉదాహరణ:
Order Created
|
↓
OrderCreated Event
|
┌────┼──────────┐
↓ ↓ ↓
Payment Inventory Notification
19. Event మరియు Command మధ్య తేడా ఏమిటి?
Command = ఏదైనా action చేయమని request.
CreateOrderCommand
Event = action ఇప్పటికే జరిగిందని notification.
OrderCreatedEvent
20. API Gateway అంటే ఏమిటి?
API Gateway అనేది clients మరియు backend microservices మధ్య entry pointగా పనిచేస్తుంది.
Mobile/Web Client
|
↓
API Gateway
/ | \
↓ ↓ ↓
Order Payment Product
Part 3: API Gateway
21. API Gateway ఎందుకు ఉపయోగిస్తారు?
API Gateway ద్వారా:
- Routing
- Authentication
- Authorization
- Rate limiting
- Load balancing
- Request transformation
- Logging
- Caching
చేయవచ్చు.
22. API Gateway మరియు Load Balancer మధ్య తేడా ఏమిటి?
Load Balancer ప్రధానంగా trafficను instances మధ్య distribute చేస్తుంది.
API Gateway API-level functionalityని provide చేస్తుంది.
ఉదాహరణ:
Client
↓
API Gateway
↓
Load Balancer
↓
Service Instances
23. Azureలో API Gatewayకి ఏ service ఉపయోగించవచ్చు?
Microsoft Azureలో Azure API Management (APIM) commonly ఉపయోగిస్తారు.
దీని ద్వారా:
- API Security
- Policies
- Rate Limiting
- Subscription Keys
- JWT Validation
- Routing
- Monitoring
వంటి capabilities లభిస్తాయి.
24. API Gateway single point of failure కాదా?
Architecture మరియు deploymentపై ఆధారపడి ఉంటుంది.
Productionలో highly available API Gateway deployment ఉపయోగించాలి.
Cloud-managed API Gateway services availability మరియు scaling కోసం designedగా ఉంటాయి.
25. API Gatewayలో Rate Limiting అంటే ఏమిటి?
ఒక client/APIకి నిర్ణీత సమయంలో ఎన్ని requests అనుమతించాలో control చేయడం Rate Limiting.
ఉదాహరణ:
Client → 100 requests/minute
Limit దాటితే requests reject/throttle చేయవచ్చు.
Part 4: Communication
26. Microservices ఒకదానితో ఒకటి ఎలా communicate చేస్తాయి?
ప్రధానంగా:
- REST
- gRPC
- Message Queue
- Event Bus
- Kafka
- Azure Service Bus
27. gRPC అంటే ఏమిటి?
gRPC అనేది high-performance RPC framework.
ఇది ముఖ్యంగా internal service-to-service communicationలో ఉపయోగించవచ్చు.
Order Service
|
gRPC
↓
Inventory Service
28. REST vs gRPC?
| REST | gRPC |
|---|---|
| HTTP/JSON common | HTTP/2 + Protocol Buffers |
| Easy debugging | High performance |
| Browser friendly | Internal service communication |
| Simple | Strong contract |
29. Message Queue అంటే ఏమిటి?
Producer messageను queueలో place చేస్తుంది.
Consumer ఆ messageను process చేస్తుంది.
Producer
↓
Queue
↓
Consumer
ఇది producer మరియు consumerని decouple చేస్తుంది.
30. Queue మరియు Topic మధ్య తేడా?
Queueలో సాధారణంగా ఒక messageను ఒక consumer process చేస్తుంది.
Topicలో ఒక eventను multiple subscriptions/consumers receive చేయవచ్చు.
Topic
|
+---- Subscription A
|
+---- Subscription B
|
+---- Subscription C
31. Azure Service Bus అంటే ఏమిటి?
Azure Service Bus అనేది fully managed enterprise messaging service.
ఇది:
- Queue
- Topic
- Subscription
- Retry
- Dead-lettering
- Scheduling
వంటి features support చేస్తుంది.
32. Kafka అంటే ఏమిటి?
Apache Kafka ఒక distributed event streaming platform.
High-volume event streaming మరియు real-time data pipelines కోసం ఉపయోగిస్తారు.
Producer
↓
Kafka Topic
↓
Consumers
33. Kafka మరియు Azure Service Bus మధ్య తేడా?
| Kafka | Azure Service Bus |
|---|---|
| Event streaming | Enterprise messaging |
| Very high throughput | Reliable messaging |
| Partition based | Queue/Topic based |
| Event replay strong | Business messaging features |
| Distributed log | Managed messaging |
34. Message ordering ఎలా maintain చేస్తారు?
Technologyపై ఆధారపడి ఉంటుంది.
Kafkaలో same partitionకి events పంపడం ద్వారా ordering maintain చేయవచ్చు.
Queue systemsలో sessions/grouping వంటి mechanisms ఉపయోగించవచ్చు.
35. Duplicate messages ఎలా handle చేస్తారు?
Distributed systemsలో duplicate delivery రావచ్చు.
అందుకే consumers idempotentగా ఉండాలి.
ఉదాహరణ:
MessageId = 123
Already processed?
|
Yes → Ignore
No → Process
Part 5: Reliability
36. Idempotency అంటే ఏమిటి?
ఒక operationను ఒకసారి లేదా multiple times execute చేసినా final result sameగా ఉండేలా design చేయడం Idempotency.
ఉదాహరణ:
ProcessPayment(PaymentId=100)
Payment ఇప్పటికే processed అయితే duplicate payment create చేయకూడదు.
37. Retry Pattern అంటే ఏమిటి?
Temporary failure వచ్చినప్పుడు operationను మళ్లీ attempt చేయడం Retry Pattern.
Request
↓
Failure
↓
Retry
↓
Success
38. Exponential Backoff అంటే ఏమిటి?
ప్రతి retryకి waiting time పెంచడం.
ఉదాహరణ:
Retry 1 → 1 sec
Retry 2 → 2 sec
Retry 3 → 4 sec
Retry 4 → 8 sec
39. Circuit Breaker Pattern అంటే ఏమిటి?
Repeated failures ఉన్నప్పుడు downstream serviceకి requests పంపకుండా కొంతకాలం circuit open చేయడం.
Closed
↓
Failures
↓
Open
↓
Wait
↓
Half Open
↓
Success → Closed
ఇది cascading failuresను తగ్గిస్తుంది.
40. Bulkhead Pattern అంటే ఏమిటి?
ఒక service/resource failure మొత్తం applicationను affect చేయకుండా resourcesను isolate చేయడం Bulkhead Pattern.
ఉదాహరణ:
Payment Requests → Pool A
Order Requests → Pool B
Search Requests → Pool C
ఒక pool సమస్య వచ్చినా మిగిలినవి continue కావచ్చు.
41. Timeout Pattern ఎందుకు అవసరం?
Downstream service response ఇవ్వకపోతే caller indefinitely wait చేయకుండా timeout పెట్టాలి.
Timeout = 5 seconds
5 secondsలో response రాకపోతే operation fail/alternative flowకి వెళ్లవచ్చు.
42. Distributed Systemలో cascading failure అంటే ఏమిటి?
ఒక service failure వల్ల dependent services కూడా failuresకి గురికావడం cascading failure.
Payment Down
↓
Order waits
↓
Checkout waits
↓
API threads increase
↓
System degradation
Timeout, Circuit Breaker, Bulkhead వంటి patterns దీనిని control చేయడంలో సహాయపడతాయి.
Part 6: Distributed Transactions
43. Microservicesలో distributed transaction అంటే ఏమిటి?
ఒక business transaction multiple services/databasesను involve చేస్తే అది distributed transaction.
ఉదాహరణ:
Order DB
Payment DB
Inventory DB
మూడు databases update చేయాల్సి వస్తుంది.
44. Distributed Transaction ఎందుకు difficult?
ప్రతి service తన databaseని independently control చేస్తుంది.
ఒక service success, మరో service failure అయితే consistency problem వస్తుంది.
45. Saga Pattern అంటే ఏమిటి?
Long-running distributed business transactionను multiple local transactionsగా break చేసి, failure వచ్చినప్పుడు compensating actions execute చేసే pattern Saga.
Create Order
↓
Reserve Inventory
↓
Process Payment
↓
Confirm Order
Payment failure అయితే:
Release Inventory
Cancel Order
వంటి compensating actions చేయవచ్చు.
46. Sagaలో Orchestration అంటే ఏమిటి?
ఒక central orchestrator workflowని control చేస్తుంది.
Saga Orchestrator
|
+→ Order
|
+→ Inventory
|
+→ Payment
47. Saga Choreography అంటే ఏమిటి?
Central orchestrator లేకుండా services events ద్వారా workflowను coordinate చేస్తాయి.
OrderCreated
↓
InventoryReserved
↓
PaymentCompleted
↓
OrderConfirmed
48. Orchestration vs Choreography?
| Orchestration | Choreography |
|---|---|
| Central coordinator | No central coordinator |
| Easier workflow visibility | More decentralized |
| Orchestrator dependency | Event dependency |
| Complex workflowsలో useful | Simple event flowsలో useful |
49. Saga failure ఎలా handle చేస్తారు?
Saga failure వచ్చినప్పుడు:
- Failure detect చేయాలి
- Retry చేయాలి
- Compensating transaction execute చేయాలి
- Event/log record చేయాలి
- Dead-letter/recovery mechanism ఉపయోగించాలి
50. Two-Phase Commit ఎందుకు avoid చేస్తారు?
2PC distributed systemsలో strong consistency ఇవ్వగలిగినా:
- Performance overhead
- Tight coupling
- Availability impact
- Long-running transactions
వంటి సమస్యలు రావచ్చు.
Microservicesలో Saga వంటి patterns ఎక్కువగా preferred.
Part 7: CQRS and Event Sourcing
51. CQRS అంటే ఏమిటి?
CQRS = Command Query Responsibility Segregation
Read మరియు Write operationsను separate modelsగా design చేయడం.
Command → Write Model → DB
Query → Read Model → Read DB
52. CQRS ఎందుకు ఉపయోగిస్తారు?
- Read/write workloads independent scaling
- Complex domain models
- Performance optimization
- Separate read/write models
- Event-driven architecture integration
53. CQRS ప్రతి Microserviceకి అవసరమా?
లేదు.
CQRS complexity పెంచుతుంది.
Business మరియు performance requirements justify చేసినప్పుడు మాత్రమే ఉపయోగించాలి.
54. Event Sourcing అంటే ఏమిటి?
Current state మాత్రమే store చేయకుండా state changesని eventsగా store చేయడం Event Sourcing.
ఉదాహరణ:
AccountCreated
MoneyDeposited
MoneyWithdrawn
MoneyDeposited
ఈ events ఆధారంగా current balance derive చేయవచ్చు.
55. CQRS మరియు Event Sourcing sameనా?
కాదు.
CQRS read/write separation గురించి.
Event Sourcing state changesని eventsగా persist చేయడం గురించి.
ఇవి కలిసి ఉపయోగించవచ్చు కానీ mandatory కాదు.
Part 8: Security
56. Microservicesలో authentication ఎలా implement చేస్తారు?
Common approach:
Client
↓
Identity Provider
↓
JWT Token
↓
API Gateway
↓
Microservices
OAuth 2.0 / OpenID Connect / JWT వంటి standards ఉపయోగించవచ్చు.
57. JWT Token అంటే ఏమిటి?
JWT = JSON Web Token.
Authentication/authorization informationని securely transmit చేయడానికి ఉపయోగించే token format.
Typical structure:
Header.Payload.Signature
58. Authentication మరియు Authorization మధ్య తేడా?
Authentication:
మీరు ఎవరు?
Authorization:
మీరు ఏ operation చేయడానికి permission కలిగి ఉన్నారు?
59. Service-to-Service authentication ఎలా చేస్తారు?
Options:
- Managed Identity
- OAuth 2.0 Client Credentials
- Certificates
- Service principals
- mTLS
Azure environmentలో Managed Identity ఒక strong option.
60. Secrets ఎక్కడ store చేయాలి?
Source codeలో secrets hard-code చేయకూడదు.
Azure environmentలో Azure Key Vault వంటి secret-management service ఉపయోగించవచ్చు.
Part 9: Docker and Kubernetes
61. Docker అంటే ఏమిటి?
Docker application మరియు dependenciesను container imageగా package చేసి consistent environmentలో run చేయడానికి ఉపయోగిస్తారు.
Application
+
Runtime
+
Dependencies
=
Docker Image
62. Container అంటే ఏమిటి?
Container అనేది isolated process environment.
Docker Host
|
+-- Order Container
+-- Payment Container
+-- Product Container
63. Docker Image మరియు Container మధ్య తేడా?
Image = Template
Container = Running instance
Image
↓
Container
64. Docker Compose అంటే ఏమిటి?
Multiple containersను local environmentలో define/run చేయడానికి Docker Compose ఉపయోగించవచ్చు.
docker-compose.yml
Order API
Payment API
SQL
Redis
Message Broker
65. Kubernetes అంటే ఏమిటి?
Kubernetes అనేది container orchestration platform.
ఇది:
- Deployment
- Scaling
- Service discovery
- Self-healing
- Load balancing
- Rolling updates
వంటి features provide చేస్తుంది.
66. Pod అంటే ఏమిటి?
Kubernetesలో Pod అనేది deployable execution unit.
సాధారణంగా ఒక application container ఒక Podలో run అవుతుంది.
Pod
|
+-- Container
67. Kubernetes Deployment అంటే ఏమిటి?
Deployment application Pods యొక్క desired stateని manage చేస్తుంది.
Deployment
|
+-- Pod
+-- Pod
+-- Pod
68. Kubernetes Service అంటే ఏమిటి?
Podsకి stable network endpoint provide చేయడానికి Kubernetes Service ఉపయోగిస్తారు.
Client
↓
K8s Service
↓
Pods
69. Kubernetesలో scaling ఎలా చేస్తారు?
Horizontal Pod Autoscaler (HPA) ద్వారా demand ఆధారంగా replicas పెంచవచ్చు/తగ్గించవచ్చు.
Low Load → 2 Pods
High Load → 8 Pods
70. AKS అంటే ఏమిటి?
AKS = Azure Kubernetes Service
Azureలో managed Kubernetes service.
Microservices containersను Kubernetes environmentలో run చేయడానికి ఉపయోగించవచ్చు.
Part 10: Service Discovery
71. Service Discovery అంటే ఏమిటి?
ఒక microservice మరో service location/IPని dynamically discover చేయడం Service Discovery.
Order
↓
Service Discovery
↓
Payment Service
72. Kubernetesలో Service Discovery ఎలా జరుగుతుంది?
Kubernetes Services మరియు DNS ద్వారా service-to-service discovery చేయవచ్చు.
ఉదాహరణ:
http://payment-service
73. Client-Side మరియు Server-Side Discovery అంటే ఏమిటి?
Client-side discoveryలో client service registryని query చేసి instanceని select చేస్తుంది.
Server-side discoveryలో load balancer/gateway service selection చేస్తుంది.
Part 11: Data Management
74. Database per Service ఎందుకు ఉపయోగిస్తారు?
ప్రతి service తన data ownershipను కలిగి ఉండేందుకు.
Order → OrderDB
Payment → PaymentDB
Inventory → InventoryDB
ఇది loose couplingను improve చేస్తుంది.
75. Microservicesలో joins ఎలా handle చేస్తారు?
Cross-database joins avoid చేయాలి.
Options:
- API composition
- Read model
- CQRS
- Data replication
- Event-driven synchronization
76. Data consistency ఎలా maintain చేస్తారు?
Depending on business requirement:
- Strong consistency
- Eventual consistency
- Saga
- Outbox Pattern
- Events
- Retry mechanisms
ఉపయోగించవచ్చు.
77. Eventual Consistency అంటే ఏమిటి?
Distributed servicesలో data immediateగా అన్ని systemsలో same కాకపోయినా కొంత సమయం తర్వాత consistent stateకి రావడం Eventual Consistency.
ఉదాహరణ:
Order Created
↓
Event Published
↓
Inventory updated
↓
Eventually consistent
78. Outbox Pattern అంటే ఏమిటి?
Database update మరియు event publishing మధ్య consistency problemను solve చేయడానికి Outbox Pattern ఉపయోగిస్తారు.
Business Transaction
|
+-- Business Data
|
+-- Outbox Event
తర్వాత background process outbox eventని message brokerకి publish చేస్తుంది.
79. Transactional Outbox ఎందుకు ఉపయోగిస్తారు?
Database transactionలో business data మరియు event రెండింటినీ save చేయడం వల్ల:
Business Update + Event Record
atomicగా persist చేయవచ్చు.
తర్వాత event publisher actual brokerకి publish చేస్తుంది.
80. CDC అంటే ఏమిటి?
CDC = Change Data Capture
Databaseలో జరిగిన changesను capture చేసి downstream systemsకి పంపడానికి ఉపయోగించే technique.
Part 12: Observability
81. Microservices Monitoring ఎందుకు difficult?
ఎందుకంటే ఒక user request multiple services ద్వారా travel కావచ్చు.
Client
↓
Gateway
↓
Order
↓
Payment
↓
Inventory
↓
Notification
ఒక request failure ఎక్కడ జరిగిందో identify చేయడం challenging.
82. Distributed Tracing అంటే ఏమిటి?
ఒక request multiple services ద్వారా travel అయినప్పుడు complete request pathను trace చేయడం Distributed Tracing.
Trace ID: ABC123
Gateway
↓
Order
↓
Payment
↓
Inventory
83. Correlation ID అంటే ఏమిటి?
ఒక business/request flowకి unique ID assign చేసి logsలో propagate చేయడం Correlation ID.
CorrelationId = ORD-10001
దీనివల్ల multiple services logs correlate చేయవచ్చు.
84. Loggingలో ఏమి capture చేయాలి?
Useful information:
- Timestamp
- Correlation ID
- Trace ID
- Service name
- Request
- Response status
- Exception
- Duration
Sensitive information log చేయకుండా జాగ్రత్త పడాలి.
85. Metrics అంటే ఏమిటి?
Application health/performanceని numbers ద్వారా measure చేయడం Metrics.
ఉదాహరణ:
Request Count
Error Rate
Response Time
CPU
Memory
Throughput
86. Health Check అంటే ఏమిటి?
Service healthyగా ఉందో లేదో verify చేసే endpoint/process.
ఉదాహరణ:
GET /health
GET /ready
87. Liveness మరియు Readiness Probe అంటే ఏమిటి?
Liveness:
Application process healthyగా ఉందా?
Readiness:
Traffic receive చేయడానికి application readyగా ఉందా?
Kubernetesలో ఇవి ముఖ్యమైనవి.
88. SLA, SLO, SLI అంటే ఏమిటి?
SLI = Service performance measurement.
SLO = Target objective.
SLA = Customer/business agreement.
ఉదాహరణ:
SLI → Availability = 99.95%
SLO → Target = 99.9%
SLA → Customer contract
Part 13: Deployment and DevOps
89. Microservices CI/CD Pipeline ఎలా ఉంటుంది?
Typical pipeline:
Developer
↓
Git
↓
Build
↓
Unit Tests
↓
Security Scan
↓
Docker Build
↓
Container Registry
↓
Deploy
↓
Kubernetes / App Service
90. Blue-Green Deployment అంటే ఏమిటి?
Two environments maintain చేస్తారు:
Blue → Current Production
Green → New Version
New version validate చేసిన తర్వాత traffic Greenకి switch చేస్తారు.
91. Canary Deployment అంటే ఏమిటి?
New versionను initially small percentage usersకి release చేస్తారు.
95% → V1
5% → V2
Metrics healthyగా ఉంటే traffic gradually V2కి shift చేస్తారు.
92. Rolling Deployment అంటే ఏమిటి?
Old instancesను gradually new instancesతో replace చేయడం Rolling Deployment.
V1 V1 V1 V1
↓
V2 V1 V1 V1
↓
V2 V2 V1 V1
↓
V2 V2 V2 V2
93. Feature Flag అంటే ఏమిటి?
Code deploy చేసినా featureను configuration ద్వారా enable/disable చేయడానికి Feature Flag ఉపయోగిస్తారు.
NewCheckoutFeature = false
94. Microservices deploymentలో configuration ఎలా manage చేస్తారు?
Configuration:
- Environment variables
- Configuration server
- Kubernetes ConfigMap
- Secret
- Azure App Configuration
- Key Vault
వంటి mechanisms ద్వారా manage చేయవచ్చు.
Part 14: Advanced Architecture
95. Strangler Fig Pattern అంటే ఏమిటి?
Legacy monolithను ఒకేసారి replace చేయకుండా functionalityని gradually microservicesగా migrate చేయడం Strangler Fig Pattern.
API Gateway
|
---------------------
| |
New Services Legacy App
|
Gradually increase
96. Anti-Corruption Layer అంటే ఏమిటి?
Legacy system మరియు new domain మధ్య translation layerగా పనిచేసే architecture pattern.
New Microservice
|
↓
Anti-Corruption Layer
|
↓
Legacy System
ఇది legacy concepts new systemలో leak కాకుండా prevent చేస్తుంది.
97. Distributed Lock అంటే ఏమిటి?
Multiple service instances ఒక shared resourceని simultaneously modify చేయకుండా coordinate చేయడానికి distributed lock ఉపయోగించవచ్చు.
Examples:
- Redis-based locks
- Database locks
- Distributed coordination systems
కానీ unnecessary locks వల్ల scalability తగ్గవచ్చు.
98. Microservicesలో caching ఎలా implement చేస్తారు?
Common caching approaches:
Client
↓
API
↓
Redis Cache
↓
Database
Cache-aside pattern commonly used.
Check Cache
|
Found → Return
|
Not Found
↓
Database
↓
Update Cache
99. Microservices architecture design చేయమంటే ఎలా approach చేస్తారు?
Interviewలో ఈ order follow చేయవచ్చు:
Step 1 – Requirements
Functional మరియు non-functional requirements identify చేయాలి.
Step 2 – Domain Analysis
Business domains identify చేయాలి.
Step 3 – Service Boundaries
Bounded contexts/business capabilities ఆధారంగా services define చేయాలి.
Step 4 – Data Ownership
ప్రతి serviceకి data ownership నిర్ణయించాలి.
Step 5 – Communication
REST, gRPC, messaging లేదా events select చేయాలి.
Step 6 – Resilience
Retry, Timeout, Circuit Breaker, Bulkhead వంటి patterns consider చేయాలి.
Step 7 – Security
Authentication, Authorization, Secrets Management.
Step 8 – Observability
Logging, Metrics, Tracing.
Step 9 – Deployment
Docker + Kubernetes/AKS/App Service.
Step 10 – CI/CD
Automated build, test, security scan మరియు deployment.
Part 15: Real-Time System Design Interview
100. E-Commerce Microservices Architecture ఎలా design చేస్తారు?
ఇది చాలా common system-design interview question.
ఒక scalable e-commerce platformను ఇలా design చేయవచ్చు:
Internet
|
↓
API Gateway / APIM
|
--------------------------------
| | | | |
↓ ↓ ↓ ↓ ↓
Customer Product Order Payment Inventory
| | | | |
↓ ↓ ↓ ↓ ↓
DB DB DB DB DB
|
↓
Message Broker
|
---------------------------
| | |
Notification Shipping Analytics
Order Flow
Customer order create చేస్తాడు:
1. Client
↓
2. API Gateway
↓
3. Order Service
↓
4. OrderCreated Event
↓
5. Inventory Service
↓
6. Payment Service
↓
7. Notification Service
↓
8. Order Confirmed
Payment failure అయితే Saga/compensation flow:
Payment Failed
↓
Release Inventory
↓
Cancel Order
↓
Send Notification
ఈ architectureలో ఉపయోగించగల technologies
Frontend
↓
Angular / React
API
↓
ASP.NET Core Web API
Gateway
↓
Azure API Management
Messaging
↓
Azure Service Bus / Kafka
Containers
↓
Docker
Orchestration
↓
AKS
Database
↓
Azure SQL / NoSQL
Caching
↓
Redis
Secrets
↓
Azure Key Vault
Monitoring
↓
Application Insights / Azure Monitor
CI/CD
↓
Azure DevOps / GitHub Actions
⭐ Bonus: Interviewలో తప్పక గుర్తుంచుకోవాల్సిన Microservices Patterns
| Pattern | Purpose |
|---|---|
| API Gateway | Single API entry point |
| Saga | Distributed transaction |
| CQRS | Read/Write separation |
| Event Sourcing | Store state changes as events |
| Outbox | Reliable event publishing |
| Circuit Breaker | Prevent cascading failures |
| Retry | Handle transient failures |
| Timeout | Prevent long waits |
| Bulkhead | Isolate failures |
| Strangler Fig | Modernize legacy applications |
| Anti-Corruption Layer | Protect new domain from legacy |
| Cache-Aside | Improve read performance |
| Service Discovery | Locate services |
| Sidecar | Add infrastructure capabilities |
| Ambassador | Proxy external communication |
⭐ Top 10 Microservices Interview Questions – Quick Revision
Interviewకి ముందు ఈ 10 questions తప్పకుండా prepare చేయండి:
- Microservices అంటే ఏమిటి?
- Monolith vs Microservices?
- Database per service ఎందుకు?
- API Gateway ఎందుకు?
- Synchronous vs Asynchronous communication?
- Saga Pattern ఎలా పనిచేస్తుంది?
- Orchestration vs Choreography?
- CQRS అంటే ఏమిటి?
- Circuit Breaker ఎందుకు?
- Microservices systemని end-to-end ఎలా design చేస్తారు?
Conclusion
Microservices interviewలో కేవలం definitions చెప్పడం కంటే real-time scenarios explain చేయడం చాలా important.
ఒక మంచి .NET Microservices developer/architectకి ఈ areasపై strong understanding ఉండాలి:
C#
↓
ASP.NET Core
↓
REST / gRPC
↓
Microservices
↓
Messaging
↓
Kafka / Azure Service Bus
↓
CQRS / Saga
↓
Docker
↓
Kubernetes / AKS
↓
Azure
↓
CI/CD
↓
Observability
Interviewలో “What happens if one service fails?”, “How do you handle distributed transactions?”, “How do you prevent duplicate messages?”, “How do you maintain consistency?”, “How do you scale one service?”, “How do you troubleshoot a request across 10 services?” వంటి scenario-based questions కూడా అడగవచ్చు.
అందుకే Microservices architectureని definitions + patterns + real-time scenarios + .NET implementation + Azure deployment అనే నాలుగు anglesలో prepare చేసుకోవడం ఉత్తమమైన approach.
