
A monolith is one application where all the business modules like user, product, order and payment are built, packaged and deployed together as a single unit, running in one process and usually sharing one database. It is simple to build and deploy in the beginning, but as it grows every small change needs a full redeployment. And one thing to be careful about: a modular monolith is still a monolith, because the modules are separated in code but they are still deployed together. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
As a monolith grows the modules get tightly coupled through one codebase and one database, so builds and deployments become slow and risky, one bug can take the whole application down, and you cannot change the technology of just one module. And the biggest one is scaling. During a sale only product browsing needs more capacity, but in a monolith I have to scale the entire application. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Microservices architecture splits an application into small services built around business capabilities, like user, product, order and payment. Each service owns its own data, can be deployed and scaled independently, and talks to other services through APIs or events, usually behind an API gateway. If the services must be deployed together, it is not really microservices. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Microservices solve the problems of a growing monolith. Each service can be deployed and scaled on its own, a failure stays inside one service instead of taking down the whole application, teams own their services end to end and release faster, and each service can pick the right technology. For example during a flash sale I scale only the product service. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Microservices add network calls and latency, debugging needs distributed tracing with a trace ID across services, and you lose simple ACID transactions so you deal with eventual consistency, sagas and compensating actions. On top of that you need more infrastructure, monitoring and DevOps maturity. So I only choose microservices when the benefits are clearly bigger than this cost. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
I would not use microservices for a small application, a small team, a simple business domain or a low traffic system, because the overhead is bigger than the benefit. I would start with a well structured monolith, discover the bounded contexts as the business grows, and then split out services step by step when the scale and the team size really justify it. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
A bounded context is a boundary inside which a domain model has one clear meaning. For example product in the catalog context means name, type and price, but product in the order context means quantity and the price at the time of order. Each context owns its own model, and very often one bounded context becomes one microservice. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Domain-Driven Design is a way of designing software around the business domain, using the same language the business uses. The code is split into presentation, application, domain and infrastructure layers, and the most important rule is that the domain does not depend on the infrastructure. So if I move from MySQL to MongoDB or from Kafka to RabbitMQ, only the infrastructure layer changes and the business logic stays the same. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
An entity has a unique identity and its state can change, like a customer. A value object has no identity and is immutable, like an address. An aggregate is a group of entities and value objects that is changed as one unit through its root, like an order with its items. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Domain-Driven Design helps me find the right service boundaries. Each bounded context I discover, like orders, payments or inventory, is a natural candidate for one microservice. Because the services follow business boundaries and not technical layers, they stay loosely coupled, each team owns one business area, and I avoid splitting the system in the wrong place. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Loose coupling means one service depends only on what another service exposes, its API, contract or events, and never on how it works inside. For example, order service just asks payment service for a payment. If payment moves from Razorpay to Stripe or UPI, only payment service changes and order service is not touched. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
High cohesion means everything that belongs to one business capability stays together in one service. Order service handles creating, cancelling and the history of orders, but not payments, emails or stock updates. Those belong to payment, notification and inventory services. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
High cohesion keeps related things together, and loose coupling keeps unrelated things apart. Together they make a change stay inside one service. If payment moves from Razorpay to UPI, only payment service changes and order service is not touched. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Service autonomy means each service can be built, changed, deployed and scaled on its own, without waiting for other teams. It owns its business logic, its database and its release cycle, and it can even pick its own tech stack. For example, payment service can move to Java 21 or add UPI without telling order service, because order service only needs to know whether the payment succeeded or failed. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Independent deployment means I can release one service without redeploying any other service. Each service has its own CI/CD pipeline, so if I ship payment service version two, order, user and inventory keep running. Even if that deployment fails, users can still log in and browse the catalog. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Independent scalability means each service is scaled on its own load, not the whole application. During a flash sale product browsing gets about twenty times more traffic than payments, so I run twenty pods of product service and only two of payment service. I pay only for the capacity I need, the spike is handled where it happens, and the load on one service does not slow down the others. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Decentralized data management means every service owns its own data store, which is the database per service pattern. Order service can use a NoSQL database while payment service uses SQL, and each team changes its own schema without breaking anyone else. Services never share a database. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Decentralized governance means each team picks the language, framework and tools that suit its own service, so you get a polyglot system and faster decisions. The trade-off is operations. If every service uses a different stack, debugging one production issue across services gets very hard. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Conway's Law says a system's design ends up mirroring the communication structure of the organisation that builds it. If teams are split into frontend, backend and database, every feature needs all of them and the system becomes tightly coupled. So for microservices we build cross-functional teams around business domains, like an order team that owns order service end to end. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
I identify services from the business, not from technical layers. I start with the business capabilities, use domain-driven design to find the bounded contexts, and give each context clear ownership of its own data. Then I group related functions together so each service has high cohesion and low coupling. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Service decomposition is the process of breaking a large monolith into small, independently deployable services. I identify the business capabilities, define bounded contexts, reduce the dependencies between them, and make sure each service owns its own logic and its own database, not just its own table. Services then talk through synchronous or asynchronous calls instead of sharing data. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Always decompose by business capability, like order, payment and user services. That gives high cohesion, clear ownership, and independent deployment and scaling, and it matches domain-driven design. Splitting by technical layer, like a controller service, a validation service and a database service, is an anti-pattern, because every feature then needs all of them, so they are tightly coupled and talk to each other all the time. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Service granularity is the size and scope of a service. If it is too fine-grained, like splitting payment into validation, processing and auditing services, you get many network calls, more latency and more to operate. If it is too coarse, like merging order, payment and inventory, you are back to a monolith. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
A domain service holds business logic that does not naturally belong to a single entity or aggregate. For example, calculating the final price of an order needs the order, the customer, the products, coupons and tax rules, so I put it in a pricing domain service. It lives in the domain layer, it is usually stateless, and it is part of domain-driven design. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
A shared service gives common functionality to many services, like email, SMS or notifications, either as a shared library or as its own service. It avoids duplicate code, but every new shared piece adds coupling. If the email service goes down, order and payment both feel it. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
In the database per service pattern each service owns its own database and no other service can access it directly. Order can use PostgreSQL, payment MySQL and catalog MongoDB, which is called polyglot persistence. Each team controls its own schema and deploys and scales on its own. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
A shared database couples services through the schema. One schema change can break several services and force them to deploy together. Nobody clearly owns the data, so you get conflicts and lost updates. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
A service owning its data means only that service reads and writes its database. If order service needs payment data, it calls payment service through an API or listens to its events. It never connects to the payment database directly. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
A smart endpoint is a service that holds its own business logic and makes its own decisions. For example, order service validates stock, calculates the total, discounts and tax, and then triggers the payment, all inside the service. It is the first half of the principle smart endpoints and dumb pipes, where the intelligence lives in the services, not in the communication layer between them. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Dumb pipes are the communication channels between services, like HTTP calls, Kafka or RabbitMQ, that only carry messages from one service to another. They do not run business rules, transform data or make decisions. All the logic stays in the smart endpoints. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
A distributed system is a set of independent services running on different machines that talk over a network and work together, so to the user it looks like one system. In e-commerce, order, payment, inventory and notification each run on their own nodes. Each part can scale on its own, and if one node fails, like notifications, the rest of the system keeps working. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Once services talk over a network, the network becomes part of your application. You get network latency and network failures, partial failures where one service is down while others work, data consistency across many databases, distributed transactions, service discovery because pod IPs keep changing, clock differences between machines, and much harder monitoring and debugging. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Network latency is the time a request takes to travel between services, usually measured in milliseconds. One call may cost fifty milliseconds, but a chain of ten synchronous calls can add up to half a second. You cannot remove it, so I keep call chains short, call services in parallel where I can, use async messaging and caching, and check the total against the response time the business needs. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
A partial failure is when some parts of a distributed system work while others fail. For example, order service creates the order and inventory reserves stock, but payment service is down, so the order cannot finish end to end. The site is still up and users can log in and browse, but one business flow is broken, and without good monitoring it is easy to miss. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Partial failure is hard because the caller cannot tell what actually happened. If order service gets no reply from payment, payment may be down, slow, unreachable, or it may have taken the money and the reply got lost. Blind retries can charge the customer twice, and wrong timeouts can cascade. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
A network partition is when nodes cannot talk to each other because the network between them fails, even though every node is still running. Service A thinks B is down and B thinks A is down. If both sides keep accepting writes, their data drifts apart. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
The CAP theorem says that when a network partition happens, a distributed system has to choose between consistency and availability. Consistency means every read gets the latest data or an error. Availability means every request gets a response, even if the data is stale. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Consistency in CAP means every node shows the same, latest data, so after a write every read returns the new value. If my balance goes from five hundred to three hundred, no node may still show five hundred. It is usually done with synchronous replication, and if a node cannot be sure it has the latest data, it returns an error instead of stale data. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Availability in CAP means every request gets a non-error response, even during a partition, though the data may be slightly old. A product catalog is a good example. If one node is cut off, it still serves the catalog from its own copy, maybe with an old price or stock count, but the store stays open. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Partition tolerance means the system keeps working even when the network between nodes or regions breaks. If two regions cannot reach each other, each one keeps serving its own users with its own nodes and database replicas. Because networks do fail, real distributed systems have to be partition tolerant, and the design question is how they behave while the partition lasts. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Partition tolerance is mandatory because network failures will happen. Routers fail, data centres get cut off, cloud providers have outages. A distributed system cannot opt out of that, so P is not really a choice. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
PACELC extends CAP. If there is a partition, you choose between availability and consistency, just like CAP. Else, when everything is healthy, you still choose between latency and consistency, because waiting for every replica to confirm a write is slower. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Strong consistency means that once a write is acknowledged, every later read from any node returns that value. For example, the leader replicates a ten thousand rupee deposit to all replicas synchronously and only then confirms it. There is never stale data, but writes are slower and availability can drop, because the system has to wait for the replicas. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Eventual consistency means replicas can be out of sync for a short time, but if no new updates come, they all converge to the same value. For example, node A is updated and sends an event through Kafka, and node B applies it a little later. In between, a read from B can return old data. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Causal consistency means that operations which are causally related are seen by everyone in the same order. If I post Hello and then Welcome everyone in a group chat, nobody sees Welcome first. Unrelated updates can still arrive in any order. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Split-brain happens when a network partition splits a cluster and each side elects its own leader, so two leaders accept writes at the same time. One sets the balance to five thousand and the other to seven thousand. When the network heals, you have conflicting writes, lost updates and corrupted data. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Distributed consensus is how several nodes agree on one value, like who the leader is or whether a transaction commits. It prevents split-brain and keeps replicas consistent. It is hard because nodes crash, messages get delayed, lost or reordered, and partitions happen. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
The FLP impossibility result says that in a fully asynchronous system, no deterministic algorithm can guarantee that nodes always reach agreement if even one node may crash, because a crashed node and a very slow node look the same. Real systems work around it with timeouts, leader election, retries and majority quorums, which is how Raft, Paxos and ZooKeeper still make progress. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
In code-first, the backend team writes the code first and the API contract simply comes out of that code. The frontend has to wait, and when the backend later changes the request or response, the frontend breaks. It is fast for a small internal service, but for shared APIs it causes integration problems, which is why most teams now prefer API-first design. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
API-first design means the teams agree on the API contract before anyone writes code, like the endpoint, the request body and the response. The contract is reviewed and approved, then the backend implements it while the frontend builds against a mock of the same contract. Teams work in parallel, the APIs stay consistent, and there are far fewer integration surprises. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Contract-first development is how you implement API-first. You write the contract first in a machine-readable format like an OpenAPI YAML file, review it with the consumers, and then generate server stubs and client code from it. The spec becomes the single source of truth for every team, and you can validate requests and responses against it. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
In consumer-driven contract testing, the consumer writes down exactly what it expects from a provider, and the provider runs those expectations in its own build. If order service expects a field called paymentStatus and payment service renames it to status, the provider's build fails before deployment. The most common tool for this is Pact. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Backward compatibility means existing clients keep working after you change an API. So I only make additive changes, like adding an optional field, and I never rename or remove fields or change their meaning in the same version. Old mobile app version 1.5 keeps reading name, while version 2 can also read the new email field. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
API versioning lets you ship breaking changes without breaking existing consumers. You keep the old version running and add a new one, then move clients across over time. The common ways are a version in the URL like v1 and v2, a custom version header, a query parameter, or content negotiation through the Accept header. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
URI versioning puts the version in the path, like slash v2 slash orders. It is easy to see, test and route at the gateway, but it adds the version to every URL and often duplicates controller code. Header versioning keeps URLs clean and is closer to REST, but it is hidden and harder to test and cache. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Semantic versioning uses MAJOR.MINOR.PATCH. Increase the major version for breaking changes, like Spring Boot 2 to 3, the minor version for new backward-compatible features, like 3.2 to 3.3, and the patch version for bug fixes, like 3.2.1 to 3.2.2. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
API deprecation means marking an API or version as scheduled for removal while it still works. You tell consumers through documentation, Deprecation and Sunset response headers or warnings, and you point them to the replacement. New development should avoid it, and existing clients get time to migrate before the API is actually retired. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
I retire an API gradually, never suddenly. First I announce it and mark it as deprecated with a clear sunset date. I publish a migration guide to the new version, then monitor traffic to see who is still calling the old one and reach out to those teams. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
QUERY is a newly standardised HTTP method for read requests that need a request body. Complex searches used to go either into very long GET URLs or into POST requests that only read data, which is semantically wrong. QUERY takes a body like POST, but it is safe and idempotent like GET, so the server knows the request will not change anything. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
GET has no meaningful body, and servers, proxies and gateways often drop one if you send it. POST has a body but is neither safe nor idempotent. QUERY has a body and is both safe and idempotent. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
Because QUERY is safe and idempotent, its responses can be cached and a failed request can be retried automatically, which is not safe with POST. Use it for complex read-only operations like product search with many filters, Elasticsearch style queries, read-only GraphQL and vector search. It is very new, so check that your framework, gateway and clients support it. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
In synchronous communication, the caller waits for the response, like order service calling payment over REST. It is simple and gives an immediate answer, but adds latency and couples both services at runtime. In asynchronous communication, the caller publishes an event, for example to Kafka, and moves on. The lecture explains it with a real-world example and ends with a short answer you can give in the interview.
REST is synchronous request response, so I use it when the caller needs an immediate result, like user facing queries and simple CRUD. Messaging is asynchronous, so I use it to decouple services, for long running workflows and for fan out. If one OrderCreated event has to reach inventory, payment, notification and analytics, I publish one event instead of making four REST calls that all have to be up. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
RPC, remote procedure call, lets a service call a method on another machine as if it were a local method, while the framework hides the network call. REST is resource oriented with URLs and HTTP verbs, while RPC is action oriented, like processPayment. It is popular for fast internal communication and it is the foundation of gRPC. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
gRPC is a high performance RPC framework from Google that runs on HTTP/2, uses Protocol Buffers as a compact binary format and supports bi-directional streaming with strongly typed contracts. REST with JSON is human readable and works everywhere, so it suits public APIs. gRPC is faster with smaller payloads, so it suits internal service to service calls. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Protocol Buffers is Google's language neutral binary serialization format used by gRPC. I define the message once in a .proto file with numbered fields, the compiler generates classes for every language, and objects are serialized straight to compact binary and back. Compared to JSON the payload is smaller and parsing is faster, and the shared schema avoids mismatches. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
In a message-driven architecture services communicate by sending messages through a broker like Kafka or RabbitMQ instead of calling each other directly. That makes the communication asynchronous, loosely coupled and fault tolerant, because the broker holds the message until it is processed. A message is usually a command for a known receiver, like reserve inventory, while in event-driven architecture an event says something already happened, like order created, for any number of consumers. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Event-driven architecture is a style where services communicate through events, which are facts that something already happened, like OrderCreated. Producers publish events to a broker such as Kafka and any number of consumers react, without the producer knowing who they are. Adding a new consumer needs no change in the producer, and each service scales and fails independently. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
A command is an instruction to one specific receiver to do something in the future, like ProcessPayment, and the receiver may accept or reject it. An event is a notification that something already happened, like PaymentCompleted, broadcast to any number of consumers who decide for themselves whether to react. Commands are named as imperatives and events in the past tense. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Publish-subscribe is a messaging pattern where a publisher sends a message to a topic and every subscriber gets its own copy, so it is one-to-many and the publisher does not know the subscribers. For example, OrderCreated is received by inventory, notification and analytics. In Kafka I give each service its own consumer group, so every service gets every event, while instances inside one group share the partitions to split the load. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
In point-to-point messaging a producer sends messages to a queue and each message is processed by exactly one consumer, even if many consumers are listening. It is used for task distribution, like generating invoices across five worker instances, and you scale by adding workers. Pub-sub delivers every message to every subscriber, while point-to-point delivers it once. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Message ordering means consumers process messages in the order they were produced, like OrderCreated, then PaymentCompleted, then OrderShipped. It is hard because of parallel partitions and consumers, network delays, retries and reprocessing. Kafka only guarantees ordering within a partition, so I use the order ID as the message key, which sends all events of one order to the same partition while other orders still run in parallel. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
An operation is idempotent when running it many times has the same effect as running it once. It matters because in distributed systems duplicates are normal: networks fail and clients retry, producers resend, and brokers like Kafka deliver at least once. Without idempotency a retried payment can charge the customer twice. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
I use an idempotency key: the client sends a unique request ID, and the server stores processed IDs with their result and returns that result on a repeat. I back it with a unique database constraint, like one payment per order ID, so concurrent duplicates fail safely. For Kafka consumers I keep a processed-messages table and insert the event ID in the same transaction as the business update. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
A correlation ID is a unique ID created at the entry point, usually the API gateway, to track one business request across all services. It is passed downstream in an HTTP header or Kafka message header, and every service writes it into every log line, in Spring using a filter and the logging MDC. Then searching that one ID in ELK or Splunk shows the full journey of the request, which makes production debugging much faster. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
A trace ID is generated by the tracing framework, like OpenTelemetry or Micrometer Tracing, and ties together all spans of one request so tools like Zipkin or Jaeger show the full path with timings for every hop. A correlation ID is a business-level ID created by the application, like ORDER-12345, used mainly in logs, and it can span many requests of the same order. One order can have one correlation ID and many trace IDs, and I log both. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Spring Cloud is a set of projects built on top of Spring Boot that solves the common problems of distributed systems. Spring Boot is great for building one service, but once many services talk to each other you need service discovery instead of hardcoded URLs, centralized configuration, load balancing, an API gateway, circuit breakers and distributed tracing. Spring Cloud gives ready-made, consistent solutions for these so teams don't build their own. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Spring Cloud maps each distributed-system problem to a component: Spring Cloud Config for configuration, Eureka or Kubernetes for service discovery, OpenFeign for service calls, Spring Cloud LoadBalancer (which replaced Ribbon), Spring Cloud Gateway (which replaced Zuul), Resilience4j (which replaced Hystrix), Spring Cloud Stream for messaging, and Micrometer Tracing with OpenTelemetry, which replaced Sleuth in Spring Boot 3. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Spring Boot is for building a single standalone service quickly, with auto-configuration, an embedded server, REST support and Actuator. Spring Cloud is for making many such services work together, with service discovery, centralized config, an API gateway, load balancing and resilience. Spring Cloud is built on top of Spring Boot, so it cannot exist without Boot, but Boot works fine without Cloud. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Service registration is the process where a service, when it starts, adds itself to a service registry like Eureka. It sends its name, IP address, port, health status and metadata like version or zone. After that it keeps sending heartbeats, and if the heartbeats stop, the registry removes the instance. When it shuts down cleanly, it deregisters itself. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Service discovery is how a service finds the current network address of another service at runtime, without hardcoding it. It is required because in microservices instances are dynamic. Containers restart with new IPs, auto scaling adds and removes instances, some instances become unhealthy, and deployments change addresses. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
In client side discovery the calling service itself is responsible for finding and choosing the instance. For example, order service gets the list of payment instances from Eureka, caches it locally and refreshes it every 30 seconds, picks one instance with a load balancing rule like round robin, and calls it directly. In Spring Boot I do this with the Eureka client and Spring Cloud LoadBalancer, which replaced Ribbon, using OpenFeign or a LoadBalanced RestClient. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
In server side discovery the client does not talk to the registry at all. It sends the request to one fixed address, a load balancer, router or gateway, and that component knows the healthy instances, picks one and forwards the request. For example, in Kubernetes order service simply calls payment service by its service name, and Kubernetes routes the call to a healthy pod. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Both solve the same problem, finding a healthy instance, but in different places. In client side discovery, like Eureka with Spring Cloud LoadBalancer, the client gets the instance list, picks one and calls it directly, so there is no extra hop and the client can route smartly, but every client needs the library and the cache can be slightly stale. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
A service registry is a central database of all running service instances. For each instance it stores the service name, a unique instance ID, the host and port, the status like up, down, starting or out of service, the health check URL, lease details like the last heartbeat time, and metadata such as version and zone that callers can use for smart routing. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
When an instance starts, the Eureka client registers it with its name, address and status, and callers see it after their next registry fetch, which is every 30 seconds, plus the load balancer cache, so it starts getting traffic in about 30 to 60 seconds. When it shuts down cleanly, it deregisters and is removed immediately. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Health based registration means an instance stays in the registry and gets traffic only when it is really healthy, not just alive. A heartbeat only proves the process is running, so a payment instance with a broken database would still look up and keep failing requests. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Eureka is the service registry from Netflix that is part of Spring Cloud Netflix. It has two parts. The Eureka server is a separate Spring Boot application with the EnableEurekaServer annotation that holds the registry, accepts registrations and heartbeats, evicts dead instances and replicates to peer servers. The Eureka client sits inside every microservice. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Self preservation is a safety mode in the Eureka server. Normally Eureka evicts an instance when its heartbeats stop for 90 seconds, but if a network problem stops heartbeats from many healthy instances at once, normal eviction would empty the registry and cause an outage. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
If Eureka goes down, nothing breaks immediately, because Eureka is not in the request path. Every client keeps a cached copy of the registry, so existing services keep calling each other using the last known list. But over time the cache gets stale. New instances cannot register, so they get no traffic. Instances that crash cannot be removed, so some calls fail. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
I run multiple Eureka servers, usually two or three in different availability zones. Each server's default zone property points to the other servers, so they register with each other as peers and replicate every registration, heartbeat and cancel to each other. There is no leader, every peer accepts writes, and replication is asynchronous, so the servers are eventually consistent for a few seconds, which fits Eureka's AP design. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Eureka works well but has clear limitations. It is eventually consistent, with asynchronous replication and client caches, so a dead instance can stay in callers' lists for a few minutes. By default it only checks heartbeats, not real health, unless I enable the health check property. Its client is Java and Spring focused, so polyglot systems are harder. It does only discovery, with no key value store, configuration or locking like Consul. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Consul is a service discovery tool from HashiCorp that also provides active health checks, a key value store, a DNS interface, multi data center support and a service mesh with Consul Connect. Consul servers use the Raft algorithm, so the registry is strongly consistent, and an agent on each machine registers services and actively calls their health endpoints, removing unhealthy ones. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Consul gives discovery with active health checks, a key value store and multi data center support. etcd is the strongly consistent Raft store behind Kubernetes, and is rarely used directly as an application registry. ZooKeeper is the older coordination service, mostly found in legacy systems. Nacos combines a registry and config server and is popular with Spring Cloud Alibaba. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
In Kubernetes discovery is built into the platform. Pods have temporary IPs, so I create a Service with a label selector, and it gets a stable cluster IP and a DNS name like payment-service, or payment-service.namespace.svc.cluster.local, resolved by CoreDNS. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
In most cases no. Kubernetes already provides registration through Services and endpoints, health checking through readiness and liveness probes, discovery through DNS and load balancing through kube proxy, and it removes dead pods within seconds instead of minutes. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Load balancing distributes incoming requests across multiple instances of a service so no single instance is overloaded. It is required for horizontal scaling, because I can handle more traffic by adding instances instead of buying a bigger machine, for high availability, because health checks take failed instances out of rotation and the others take over, for stable response times, for zero downtime rolling deployments, and for efficient use of resources. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
The main algorithms are round robin, which rotates requests evenly and is the simple default in Spring Cloud LoadBalancer, but ignores actual load. Random, which evens out statistically. Least connections, which sends the request to the instance with the fewest active connections, ideal when request durations vary a lot. Weighted, which gives bigger machines a higher share and is also used for canary releases, like 5 percent to a new version. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
In server side load balancing a separate component, like NGINX, HAProxy, the AWS application load balancer, a Kubernetes service or the API gateway, receives the request and forwards it to a healthy instance, so clients are simple and language neutral and rules are central, but there is an extra hop and the load balancer must be highly available. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Sticky sessions, or session affinity, means the load balancer always routes a user's requests to the same instance, usually using a cookie or an IP hash, typically because session data like a cart is stored in that instance's memory. The lecture explains it with an e-commerce example and ends with a short answer you can give in the interview.
Microservices interviews are not about definitions. Interviewers ask why, when and what breaks in production. This course prepares you for exactly that.
Every lecture takes one real interview question and answers it the same way:
What's covered
The course also includes scenario rounds, like "traffic still hits a crashed instance" or "users see duplicate orders", so you practise thinking like the engineer on call.
Up to date for 2026: Spring Boot, Spring Cloud Gateway, Resilience4j, OpenTelemetry and Kubernetes. Older tools like Hystrix, Ribbon and Zuul are covered only as "what replaced it", because interviewers still ask.
Plain English, no fluff. Watch one question a day, or revise a whole section the night before your interview.