Technical interview questions with detailed answers—organized by course, like Dot Net Tutorials interview sections. Original content for Toolliyo Academy.
Microservices Microservices with .NET · Microservices
a relational database (SQL) might be suitable.
NoSQL database (e.g., MongoDB, Cassandra) might be better.
Microservices Microservices with .NET · Microservices
communication between services.
needed for a task.
Microservices Microservices with .NET · Microservices
microservices all at once, which can lead to unnecessary complexity and instability.
It’s important to gradually break down the monolith into microservices, focusing on
business capabilities first.
Microservices Microservices with .NET · Microservices
deployment, where each region registers its services with a central registry, ensuring
that services in one region can discover services in another region.
Microservices Microservices with .NET · Microservices
name) for accessing a set of pods. When a pod’s IP address changes (due to scaling
or restarting), the service ensures the connection remains intact by updating the DNS
record.
Microservices Microservices with .NET · Microservices
retries with exponential backoff to prevent cascading failures. Be careful with retry
logic to avoid creating further load during failures.
Microservices Microservices with .NET · Microservices
down, all services are affected.
and failover mechanisms.
Microservices Microservices with .NET · Microservices
(e.g., Blue) while the new version is deployed to the other (Green). After
testing, switch the traffic to the Green environment.
Microservices Microservices with .NET · Microservices
the permissions each role should have.
Microservices Microservices with .NET · Microservices
local transaction managed by a single microservice. Use compensation
actions for each step to ensure consistency.
Microservices Microservices with .NET · Microservices
data consistency and avoid issues like eventual consistency.
Microservices Microservices with .NET · Microservices
Config, or HashiCorp Vault to manage configuration in a central,
environment-specific location.
Microservices Microservices with .NET · Microservices
deployment, scaling, and management of containerized applications. It allows you to:
Microservices Microservices with .NET · Microservices
memory usage, or custom metrics (e.g., request count).
automatically add more pod replicas to handle the increased traffic.
Microservices Microservices with .NET · Microservices
that a transaction either commits or rolls back across multiple services.
Microservices Microservices with .NET · Microservices
payment-service.default.svc.cluster.local).
Microservices Microservices with .NET · Microservices
dependencies like databases, APIs, or other services are involved.
Microservices Microservices with .NET · Microservices
RESTful APIs. It provides a standardized format that can be used for automatic
generation of API documentation, which can be easily shared and integrated with
tools like Swagger UI.
Microservices Microservices with .NET · Microservices
request’s URL, method, and other factors.
Microservices Microservices with .NET · Microservices
accessed data close to the services, reducing load times and network calls.
Microservices Microservices with .NET · Microservices
Microservices Microservices with .NET · Microservices
including which microservices were involved and how long each service took to
process the request.
Microservices Microservices with .NET · Microservices
especially when the Payment Service was down, causing a failure in order creation.
Microservices Microservices with .NET · Microservices
(e.g., a user's data). The client receives an access token.
Microservices Microservices with .NET · Microservices
NodePort, LoadBalancer) to manage internal and external traffic to services.
service endpoints.
Microservices Microservices with .NET · Microservices
4s, 8s) to avoid overwhelming the system. This is especially useful for
transient failures like network issues.
Microservices Microservices with .NET · Microservices
microservice, effectively acting as a reverse proxy.
Microservices Microservices with .NET · Microservices
increasing the number of pods or adjusting resource allocation.
Microservices Microservices with .NET · Microservices
Microservices are an architectural approach where an application is divided into small,
independently deployable services, each focused on a specific business function. These
services communicate with each other over APIs and are developed, deployed, and scaled
independently.
Monolithic architectures, in contrast, bundle all components of an application into a single,
tightly coupled unit. Changes or scaling require the entire application to be redeployed.
Key Differences:
monolithic is a single, tightly integrated system that can be harder to scale and
maintain as it grows.
Microservices Microservices with .NET · Microservices
failures (e.g., killing services or introducing network latency).
Microservices Microservices with .NET · Microservices
downstream services (e.g., APIs, databases).
Microservices Microservices with .NET · Microservices
for version 1, and
for version 2.
Microservices Microservices with .NET · Microservices
authorized based on their identity and behavior.
Microservices Microservices with .NET · Microservices
registry, providing information like service name, IP address, port, health status, etc.
Microservices Microservices with .NET · Microservices
1 second, then 2 seconds, then 4 seconds, and so on.
Microservices Microservices with .NET · Microservices
when a service is down and redirect requests to a fallback service.
Microservices Microservices with .NET · Microservices
independent releases, making it easier to implement CI/CD pipelines. Each service
can be deployed and updated independently, minimizing risk.
Microservices Microservices with .NET · Microservices
sessions by setting a cookie (e.g., nginx-ingress-controller) that ensures
subsequent requests from the same client go to the same service instance.
Microservices Microservices with .NET · Microservices
sync. However, this approach can lead to performance bottlenecks and higher
latency.
Microservices Microservices with .NET · Microservices
to track and understand the system’s state.
Follow :
Microservices Microservices with .NET · Microservices
OAuth tokens.
Microservices Microservices with .NET · Microservices
to avoid reliance on cookies for authentication, making CSRF attacks less
likely.
Microservices Microservices with .NET · Microservices
transaction across multiple services. While this guarantees consistency, it can be
slow and introduces high overhead.
Microservices Microservices with .NET · Microservices
APIs. Contract testing ensures that the contract (e.g., API request/response format)
is adhered to on both sides.
Microservices Microservices with .NET · Microservices
assigned dynamic addresses (e.g.,
payment-service.default.svc.cluster.local in Kubernetes).
Microservices Microservices with .NET · Microservices
deployments, helping you control how requests are routed between services.
Microservices Microservices with .NET · Microservices
or down or change IP addresses.
track and update service availability dynamically.
Microservices Microservices with .NET · Microservices
requests by verifying the OAuth token.
(Authorization: Bearer <token>).
Microservices Microservices with .NET · Microservices
fails, Kubernetes will restart the container.
probe.
Microservices Microservices with .NET · Microservices
stream (event log), making it easier to scale and distribute the system.
Microservices Microservices with .NET · Microservices
backward-compatible, so that existing services continue to work with old versions of
the schema.
Microservices Microservices with .NET · Microservices
can be partitioned by business domain. For example, the Order Service might have
its own database, and the Customer Service has another one.
Microservices Microservices with .NET · Microservices
change occurs, such as creating a new order or processing a payment. The event is
typically sent to a message broker like Kafka or RabbitMQ.
Microservices Microservices with .NET · Microservices
taken for each service call, centralizing logging for easier monitoring.
level for all requests.
Microservices Microservices with .NET · Microservices
based on certain conditions (e.g., retries for network timeouts or temporary
unavailability).
Microservices Microservices with .NET · Microservices
service instance. Handling this with load balancing can be challenging,
especially in a stateless microservices setup.
Microservices Microservices with .NET · Microservices
reducing complexity on the client side.
only interact with the API Gateway.
Microservices Microservices with .NET · Microservices
traffic. Service discovery helps clients locate the right instances of services.
Microservices Microservices with .NET · Microservices
repeated failures, preventing further calls to the failing service and giving it
time to recover.
Microservices Microservices with .NET · Microservices
RESTful endpoints with consistent, versioned URLs.
Microservices Microservices with .NET · Microservices
or real message brokers like Kafka or RabbitMQ.
Microservices Microservices with .NET · Microservices
Consul, Eureka) to find available instances of the service it needs to communicate
with. Once the client knows the available instances, it directly calls the service.
Example: The Order Service queries Eureka to get the available instances of the
Payment Service.
Microservices Microservices with .NET · Microservices
processing the same event multiple times does not result in different outcomes. This
can be achieved by checking if the event has been processed before and skipping it
if so.
Microservices Microservices with .NET · Microservices
exchanged between services is protected against eavesdropping and tampering.
Microservices Microservices with .NET · Microservices
across multiple regions or clouds.
Microservices Microservices with .NET · Microservices
notify other services to undo the changes made. For example, if a payment service
fails after inventory was reduced, the inventory service would listen for a "rollback"
event to restore stock.
Microservices Microservices with .NET · Microservices
increases the delay between each retry attempt to avoid overwhelming the
system.
Microservices Microservices with .NET · Microservices
capabilities for querying logs, metrics, and other data.
Microservices Microservices with .NET · Microservices
cross-origin requests from trusted domains.
Microservices Microservices with .NET · Microservices
microservices to instrument HTTP requests, database calls, or other
significant events.
Microservices Microservices with .NET · Microservices
update (based on a timestamp or version number) is considered the correct one.
Microservices Microservices with .NET · Microservices
Continuous Deployment (CD) pipelines to manage deployments. This ensures each
microservice is independently tested and deployed, enabling quick and reliable
delivery of updates.
Microservices Microservices with .NET · Microservices
authentication, rate-limiting, and access control.
Microservices Microservices with .NET · Microservices
time-series metrics from microservices.
Microservices Microservices with .NET · Microservices
monitor how long a request takes to travel through the system and where bottlenecks
occur.
Microservices Microservices with .NET · Microservices
Availability, or Partition Tolerance—not all three. Microservices must be designed
to prioritize partition tolerance (PT) and decide how to balance consistency and
availability.
Microservices Microservices with .NET · Microservices
business capabilities that can be made into separate services.
Microservices Microservices with .NET · Microservices
same client are always sent to the same instance of a service.
Microservices Microservices with .NET · Microservices
dividing services or resources (e.g., database connections, threads) into
isolated pools.
Follow :
Microservices Microservices with .NET · Microservices
(Elasticsearch, Logstash, Kibana), Fluentd, or Graylog. These allow you to
aggregate logs from multiple services into a single, searchable repository, making it
easier to troubleshoot and analyze issues.
Microservices Microservices with .NET · Microservices
key (e.g., user ID). Each microservice can manage its own shard.
Microservices Microservices with .NET · Microservices
be challenging if services are frequently scaled or updated. Use health checks to
ensure only healthy services are discoverable.
Microservices Microservices with .NET · Microservices
eventual consistency, meaning that data across services may not be immediately
synchronized. Handling eventual consistency can be challenging, especially when
dealing with critical operations that require immediate consistency.
Microservices Microservices with .NET · Microservices
Keycloak) to handle user login and issue access tokens (JWT). The authentication
service verifies credentials (e.g., username/password) and provides tokens for users
to access microservices.
Follow :
Microservices Microservices with .NET · Microservices
Review the concept and prepare a concise verbal explanation with a real project example.
Microservices Microservices with .NET · Microservices
authorization, rate limiting, and traffic management.
Microservices Microservices with .NET · Microservices
configuration properties for microservices. Configuration values (e.g.,
database URLs, service endpoints) can be stored in a versioned Git
repository or a file system, and services fetch their configurations
dynamically.
multiple services.
Microservices Microservices with .NET · Microservices
eavesdropping and tampering.
Microservices Microservices with .NET · Microservices
consistency where services are allowed to be temporarily inconsistent, but will
eventually converge to a consistent state through events. Event-driven architectures
with tools like Kafka or RabbitMQ are commonly used to propagate changes and
synchronize services.
Microservices Microservices with .NET · Microservices
logs machine-readable and easy to search and analyze.
Microservices Microservices with .NET · Microservices
microservices and forward them to a centralized log management system.
Microservices Microservices with .NET · Microservices
reconstruct the state, providing an audit trail for all business actions.
Microservices Microservices with .NET · Microservices
events. When a service updates data, it emits an event, and other services subscribe
to those events to update their own state.
Microservices Microservices with .NET · Microservices
service-name.namespace.svc.cluster.local). Kubernetes automatically
registers services and their IP addresses with the DNS system.
namespace can be accessed at
payment-service.default.svc.cluster.local.
Microservices Microservices with .NET · Microservices
infrastructure (e.g., Kubernetes DNS).
Microservices Microservices with .NET · Microservices
support multiple versions of events, ensuring compatibility with older consumers.
Microservices Microservices with .NET · Microservices
address and port when they start up.
Microservices Microservices with .NET · Microservices
their own pool to avoid resource contention with non-critical services (e.g.,
notifications).
Microservices Microservices with .NET · Microservices
event-sourcing database) where it logs every state change as an event.
Microservices Microservices with .NET · Microservices
Microservices Microservices with .NET · Microservices
Azure VM Scale Sets) to scale services based on load.
ElastiCache) to offload frequently accessed data and reduce load on
databases.
Balancer, GCP Load Balancing) to distribute traffic across multiple
instances of your microservices.
performance using tools like Prometheus, Grafana, AWS CloudWatch, or
Azure Monitor.
Microservices Microservices with .NET · Microservices
migrations independently, allowing teams to evolve services and databases without
affecting others.
Microservices Microservices with .NET · Microservices
supports session affinity. The load balancer can route traffic to the same backend
server based on cookies or IP address.
Microservices Microservices with .NET · Microservices
transactions in microservices without locking resources or requiring a distributed
transaction manager. Sagas break a transaction into smaller, manageable steps, with
each microservice handling its own local transaction.
Microservices Microservices with .NET · Microservices
data) when a service is unavailable or slow.
Microservices Microservices with .NET · Microservices
backward compatibility. This enables independent evolution of microservices without
breaking other services that depend on older versions.
Microservices Microservices with .NET · Microservices
difficult. It's not easy to ensure that all services in a distributed environment either
commit or roll back changes in a single, atomic transaction. Solutions like the Saga
pattern or Eventual Consistency are commonly used instead.
Microservices Microservices with .NET · Microservices
system.
service discovery (e.g., Consul, Eureka) to track services.
Microservices Microservices with .NET · Microservices
checked by service discovery systems (like Consul, Eureka, or Kubernetes)
to ensure that only healthy services are available for discovery.
Follow :
Microservices Microservices with .NET · Microservices
ensure backward compatibility.
improvements, and patch updates.
interact without breaking functionality (e.g., /v1/orders, /v2/orders).
Microservices Microservices with .NET · Microservices
the service has recovered.
Microservices Microservices with .NET · Microservices
Events are processed asynchronously, ensuring eventual consistency.
Microservices Microservices with .NET · Microservices
to all participant services (e.g., databases).
ensuring its local transaction is successful) and responds with a vote (either
commit or abort).
Microservices Microservices with .NET · Microservices
prevent cascading issues.
Follow :
Microservices Microservices with .NET · Microservices
databases instead of in the service itself.
Microservices Microservices with .NET · Microservices
requests contain valid tokens before forwarding them to the appropriate
service.
Microservices Microservices with .NET · Microservices
"Payment Processed") and publishes them to a message broker.
Microservices Microservices with .NET · Microservices
to maintain compatibility with older clients.
Microservices Microservices with .NET · Microservices
external calls, so that they don't block indefinitely.
Follow :
Microservices Microservices with .NET · Microservices
OpenAPI or Swagger. This helps teams understand the expected inputs, outputs,
and behavior of each API endpoint.
Microservices Microservices with .NET · Microservices
Consul, or etcd to manage configuration centrally. Each service can pull its
configuration from a central repository, making it easier to update configurations
across all environments.
Microservices Microservices with .NET · Microservices
multiple microservices without having to log in separately to each one. This is
achieved through centralized authentication (e.g., Keycloak, OAuth2, or Okta).
Microservices Microservices with .NET · Microservices
persistent messages (e.g., Kafka, RabbitMQ). This ensures messages are not lost
even if the broker crashes.
Microservices Microservices with .NET · Microservices
services. To mitigate, you can use feature flags or test in isolated environments.
Follow :
Microservices Microservices with .NET · Microservices
instances of a service. It then chooses a suitable instance to connect to.
Microservices Microservices with .NET · Microservices
to trace the flow of a single request across the system.
end-to-end.
Microservices Microservices with .NET · Microservices
to manage, search, and analyze the data.
consolidate logs from all services.
Microservices Microservices with .NET · Microservices
service expectations before they reach production, reducing integration issues.
Microservices Microservices with .NET · Microservices
acts as an intermediary, decoupling the services. It distributes the events to multiple
consumers.
Microservices Microservices with .NET · Microservices
schemas. Use tools like Flyway or Liquibase for automatic version control.
Microservices Microservices with .NET · Microservices
data and ensure traffic management, monitoring, and observability across
services.
Microservices Microservices with .NET · Microservices
ensures the system remains aware of service instances and can route requests to
healthy ones.
Microservices Microservices with .NET · Microservices
microservices to Elasticsearch.
Microservices Microservices with .NET · Microservices
claims (e.g., roles, permissions). This token is used to access microservices securely.
Microservices Microservices with .NET · Microservices
circuit breaker “opens” and stops the calls to the service.
Microservices Microservices with .NET · Microservices
(using mTLS), and fine-grained authentication and authorization policies.
Microservices Microservices with .NET · Microservices
schema do not break existing consumers. For example:
ignore them.
Microservices Microservices with .NET · Microservices
pods for each service and updates the Endpoints resource. When a pod is added or
removed, the service discovery system automatically updates the list.
Microservices Microservices with .NET · Microservices
excess traffic if the queue length exceeds a threshold.
Microservices Microservices with .NET · Microservices
predefined response) when a service is unavailable.
Microservices Microservices with .NET · Microservices
service-to-service communication across multiple regions, providing consistent
service discovery, load balancing, and security policies.
Follow :
Microservices Microservices with .NET · Microservices
manage infrastructure in a declarative way, ensuring reproducibility and scalability of
environments.
Microservices Microservices with .NET · Microservices
my-service.my-namespace.svc.cluster.local) to the appropriate pod IPs.
Microservices Microservices with .NET · Microservices
reverse proxy can then use this cookie to route subsequent requests from the same
user to the same service instance.
Microservices Microservices with .NET · Microservices
and enforces role-based or attribute-based access control to determine if the user
has permission to access specific resources.
Microservices Microservices with .NET · Microservices
identifier (like a UUID) that allows services to track which messages have been
processed. When a message with the same ID arrives, it’s ignored.
Microservices Microservices with .NET · Microservices
JWT token can be shared between microservices, enabling secure access without
the need to re-authenticate.
Microservices Microservices with .NET · Microservices
messages, and implement retry logic in case of failure. Consumers can retry
processing if they fail, ensuring events are eventually processed.
Microservices Microservices with .NET · Microservices
proper deserialization, processing, and acknowledgment).
Microservices Microservices with .NET · Microservices
prevent a failure in one service from affecting others.
Microservices Microservices with .NET · Microservices
Functions, or Google Cloud Functions for burstable or event-driven
workloads to avoid idle time.
workloads that can tolerate interruptions, reducing costs significantly.
ensuring you’re only paying for the resources you need.
Microservices Microservices with .NET · Microservices
for management.
lifecycle of microservices (like scaling, rolling updates).
and manage internal communication.
based on traffic, ensuring that resources are efficiently utilized.
Example: After containerizing a User Service using Docker, you would deploy it to a
Kubernetes cluster using a Deployment and expose it with a Service for communication
with other microservices.
Microservices Microservices with .NET · Microservices
Benefits:
Follow :
demand.
independently.
Challenges:
CI/CD pipeline.
Microservices Microservices with .NET · Microservices
thread pools) for each microservice or component.
Microservices Microservices with .NET · Microservices
unittest.mock for Python) to simulate interactions with external services, databases,
and other components.
Microservices Microservices with .NET · Microservices
changes. These methods allow you to deploy new versions gradually and roll
back easily if issues arise.
version using container images or deployment configurations stored in a
versioned system.
Example: If the Order Service is updated to a new version and a bug is detected, you can
use Kubernetes or Docker to quickly roll back to the previous stable version of the container.
Follow :
Microservices Microservices with .NET · Microservices
minimize this, use local caching of service discovery results and reduce the
frequency of lookups.
Follow :
Microservices Microservices with .NET · Microservices
and extract user roles for authorization.
forwarding the request to the microservices.
Follow :
Microservices Microservices with .NET · Microservices
a single response to the client, improving client experience.
inventory service, and shipping service.
Microservices Microservices with .NET · Microservices
gateway can become complex as the system scales.
configurations to keep the gateway setup manageable.
Microservices Microservices with .NET · Microservices
complex. The two-phase commit pattern is often not feasible due to performance
concerns, so patterns like Saga or Compensating Transactions need to be
adopted.
Microservices Microservices with .NET · Microservices
clusters of Docker engines and provides features for scaling, load balancing, and
service discovery.
In microservices, orchestration is crucial to managing complex systems and scaling
individual services as needed.
Example: Kubernetes can automatically scale the Inventory Service when traffic increases
and roll out updates to the Payment Service without downtime.
Microservices Microservices with .NET · Microservices
usage patterns across the system, enabling easy observability.
and monitor traffic, failures, and performance.
Microservices Microservices with .NET · Microservices
Gateway, which then queries the service registry and forwards the request to the
appropriate service instance. Tools like Kubernetes provide built-in service discovery
by assigning DNS names to services, and Kubernetes automatically routes traffic to
available service instances.
Example: In Kubernetes, a Payment Service might be exposed by a Service
resource, and requests to this service are routed to healthy pods based on their
labels.
Microservices Microservices with .NET · Microservices
authentication to secure the communication.
Microservices Microservices with .NET · Microservices
encrypted databases using standards such as AES-256.
Microservices Microservices with .NET · Microservices
multi-region deployment to handle increased load and failure scenarios.
Microservices Microservices with .NET · Microservices
Follow :
can be handled at the gateway, reducing redundancy in the services.
microservice doesn’t need to implement its own authentication logic.
Microservices Microservices with .NET · Microservices
to undo the successful steps. For instance, if the Payment Service fails, you can
trigger a Compensating action to cancel the previous order creation or refund the
payment.
Microservices Microservices with .NET · Microservices
Services) to distribute traffic evenly across instances.
Microservices Microservices with .NET · Microservices
service call exceeds the timeout, it should return an error and trigger
fallback mechanisms.
Microservices Microservices with .NET · Microservices
response or route the request to an alternate service.
Microservices Microservices with .NET · Microservices
instances of services) and maintain performance.
Microservices Microservices with .NET · Microservices
in responses, and specify which domains are allowed to access the resources.
Microservices Microservices with .NET · Microservices
URLs, API keys, etc.) in environment variables or configuration files.
Microservices Microservices with .NET · Microservices
network partition, use eventual consistency models where services eventually
synchronize their data once the partition is resolved.
Microservices Microservices with .NET · Microservices
lead to inter-service dependencies that are difficult to manage, increasing the
complexity and the risk of cascading failures.
Microservices Microservices with .NET · Microservices
Follow :
application/vnd.example.v1+json.
Microservices Microservices with .NET · Microservices
to ensure service availability during high traffic or server failures.
Microservices Microservices with .NET · Microservices
preferences, shopping carts), sticky sessions ensure the user’s requests are
directed to the same instance, preventing session data loss.
ensuring that all requests from a user go to the same instance prevents
inconsistencies in data retrieval.
Example: In an Authentication Service, where a user logs in and the session is maintained
on the instance, sticky sessions ensure that subsequent requests from that user are routed
to the same service instance.
Microservices Microservices with .NET · Microservices
consumption. Kubernetes' Horizontal Pod Autoscaler can automatically
scale services in response to load.
Microservices Microservices with .NET · Microservices
specific microservice instance. Vertical scaling is more common for monolithic
applications or services that require more powerful hardware but is less
optimal for microservices due to their distributed nature.
Service that requires more processing power.
Best practice: For microservices, horizontal scaling is preferred because it increases
resilience and fault tolerance by distributing traffic and workloads across multiple instances.
Microservices Microservices with .NET · Microservices
endpoints and enforce access controls.
Microservices Microservices with .NET · Microservices
Follow :
more appropriate.
distributed databases might be better suited.
Microservices Microservices with .NET · Microservices
frequently accessed data when the service is unavailable.
Microservices Microservices with .NET · Microservices
failure, such as turning off analytics or limiting access to specific APIs while
keeping core functionality intact.
Microservices Microservices with .NET · Microservices
different microservices may hold copies of the same data, which may take time to
synchronize. Techniques like Event Sourcing and CQRS help, but they often come
at the cost of performance.
Follow :
Microservices Microservices with .NET · Microservices
Responsibility Principle (SRP) in mind, meaning each microservice should expose
only the functionality related to its domain. Avoid "fat" endpoints that do too much.
Microservices Microservices with .NET · Microservices
early and stop making requests to a service that is likely down, allowing time for
recovery.
Microservices Microservices with .NET · Microservices
to trace requests across multiple services. This helps in understanding how requests
flow through the system and identifying bottlenecks.
Microservices Microservices with .NET · Microservices
comparing versions. Services can merge changes or notify users about conflicts.
Microservices Microservices with .NET · Microservices
performance.
horizontal scaling.
Relevance to microservices: Kubernetes auto-scaling is essential in microservices to
ensure that each service can scale independently based on its needs, without manual
intervention. This allows the system to remain performant and available even as load
fluctuates.
Microservices Microservices with .NET · Microservices
clear path to migrate to newer versions.
Microservices Microservices with .NET · Microservices
Follow :
the service discovery mechanism.
Microservices Microservices with .NET · Microservices
Leaky Bucket to control the number of requests a user can make within a specified
Follow :
time period.
Microservices Microservices with .NET · Microservices
systems, and testing in production means you have to ensure these dependencies
are not negatively impacted.
Microservices Microservices with .NET · Microservices
all participants, and the transaction is finalized.
all participants, rolling back the transaction.
Follow :
Downsides: Two-phase commit can cause performance bottlenecks and is prone to
blocking if the coordinator or any participant fails during the process.
Microservices Microservices with .NET · Microservices
requests a specific service can use so that a failure in one service doesn’t
consume all resources.
Microservices Microservices with .NET · Microservices
Microservices Microservices with .NET · Microservices
and decides which services to call next.
Microservices Microservices with .NET · Microservices
Strict or Lax to ensure cookies are not sent with cross-site requests.
Microservices Microservices with .NET · Microservices
environment variables or secret management tools (e.g., HashiCorp
Vault, AWS Secrets Manager, Azure Key Vault).
Microservices Microservices with .NET · Microservices
endpoints, while a user role might only have access to read certain
Follow :
resources).
Microservices Microservices with .NET · Microservices
breaking a transaction into smaller, isolated steps, each with its own local
transaction. It uses compensating actions to undo any step if a failure occurs in one
Follow :
of the microservices.
Microservices Microservices with .NET · Microservices
eventually be consistent, even though there might be temporary inconsistencies.
To manage consistency:
Microservices Microservices with .NET · Microservices
Once the deployment is validated, gradually increase traffic to the new
Follow :
version.
Microservices Microservices with .NET · Microservices
Review the concept and prepare a concise verbal explanation with a real project example.
Microservices Microservices with .NET · Microservices
local state based on received events.
Microservices Microservices with .NET · Microservices
send a single response to the client.
Microservices Microservices with .NET · Microservices
Kafka) to decouple services and avoid blocking operations.
Microservices Microservices with .NET · Microservices
Review the concept and prepare a concise verbal explanation with a real project example.
Microservices Microservices with .NET · Microservices
Follow :
encryption between microservices.
Microservices Microservices with .NET · Microservices
authenticated user has the required permissions for the requested operation.
Microservices Microservices with .NET · Microservices
service names, and correlation IDs to trace requests across different
services.
Microservices Microservices with .NET · Microservices
default responses or alternative services can be used.
Microservices Microservices with .NET · Microservices
transactions, each handled by an individual service. Sagas manage failures by using
compensating actions, thus avoiding the need for distributed locking.
Microservices Microservices with .NET · Microservices
events. This enables asynchronous processing and decouples services, reducing the
need for synchronous coordination, which would otherwise require a global
transaction manager.
Microservices Microservices with .NET · Microservices
test, prod) to maintain separate configuration files. Tools like Spring Profiles or
Docker can be used to load the correct configuration based on the environment.
Microservices Microservices with .NET · Microservices
external services (e.g., success, failure, timeouts).
Microservices Microservices with .NET · Microservices
Resilience4j or Hystrix) are functioning correctly when services fail.
Microservices Microservices with .NET · Microservices
service name to an IP address.
Consul:
Microservices Microservices with .NET · Microservices
instances of another service and their details (e.g., IP, port).
Microservices Microservices with .NET · Microservices
Kibana (ELK Stack), Splunk, or Graylog to store and analyze logs.
Microservices Microservices with .NET · Microservices
Service and Order Service had synchronized data, especially after a payment failure.
Microservices Microservices with .NET · Microservices
and track a cookie containing information about which backend service instance to
route the request to.
Microservices Microservices with .NET · Microservices
events. For example, the Inventory Service might listen for an OrderPlaced event
and update inventory quantities.
Microservices Microservices with .NET · Microservices
services, but there might be temporary inconsistencies.
Microservices Microservices with .NET · Microservices
order-service.my-namespace.svc.cluster.local).
Microservices Microservices with .NET · Microservices
microservices or identify services that are causing performance issues.
Microservices Microservices with .NET · Microservices
your services to keep track of changes over time and make sure consumers are
aware of breaking changes.
Microservices Microservices with .NET · Microservices
API contract remains consistent over time. This involves verifying that each service
Follow :
meets the expectations of consumers and producers (e.g., using tools like Pact).
Microservices Microservices with .NET · Microservices
health checks, replication, and caching to minimize downtime.
Microservices Microservices with .NET · Microservices
real-time monitoring.
Microservices Microservices with .NET · Microservices
instances, typically based on algorithms like round-robin, least connections, or IP
hashing.
Microservices Microservices with .NET · Microservices
should be capable of routing requests to other healthy instances. This could
involve retry mechanisms or rerouting to secondary instances.
Microservices Microservices with .NET · Microservices
requests to available instances of a service.
Balancer).
Example: In Kubernetes, services are registered automatically in Kubernetes DNS, and
services can discover each other by querying the service names.
Microservices Microservices with .NET · Microservices
data is in one place.
Cons of a shared database:
Microservices Microservices with .NET · Microservices
service and allowing time for recovery.
Microservices Microservices with .NET · Microservices
Kubernetes will stop sending traffic to the service.
the service has completed its initialization.
Example: In Kubernetes, configure a livenessProbe and readinessProbe for a User
Service that checks the database connection and ensures the service is ready before
accepting traffic.
Microservices Microservices with .NET · Microservices
microservices grows, making it harder to scale.
Microservices Microservices with .NET · Microservices
based on the events they receive (e.g., the inventory service updates stock levels
when an order is created).
Follow :
Microservices Microservices with .NET · Microservices
Follow :
Microservices Microservices with .NET · Microservices
delay, to handle transient failures.
Microservices Microservices with .NET · Microservices
discovery (e.g., payment-service.service.consul).
Microservices Microservices with .NET · Microservices
changes and ensuring that services are compatible with different schema versions.
Microservices Microservices with .NET · Microservices
together different parts of the request journey.
Microservices Microservices with .NET · Microservices
integration) that supports multi-region failover, routing users to the nearest
region based on the DNS resolution.
Microservices Microservices with .NET · Microservices
external traffic to the appropriate services within the Kubernetes cluster.
and load balancing across multiple service instances.
Microservices Microservices with .NET · Microservices
ensure consistency by using a series of compensating transactions in
case of failure.
Microservices Microservices with .NET · Microservices
region), you can use a shard key to distribute data across multiple databases or
servers.
Follow :
Microservices Microservices with .NET · Microservices
services, requesting the data they need to keep their own data store in sync.
Follow :
Microservices Microservices with .NET · Microservices
automatically fetch updated configurations when deployed.
Microservices Microservices with .NET · Microservices
instances and their corresponding logs.
track dynamic infrastructure and provide observability.
Microservices Microservices with .NET · Microservices
events are durable and can be replayed if needed.
Microservices Microservices with .NET · Microservices
compatibility between different versions of APIs.
Tools:
Follow :
Microservices Microservices with .NET · Microservices
and traces for a comprehensive view of service health.
Microservices Microservices with .NET · Microservices
first add the new field as nullable, then gradually update services to use it before
removing old columns.
Microservices Microservices with .NET · Microservices
client is authorized and has appropriate permissions. This is done by checking the
token's signature and expiration date.
Example: A client app (e.g., a mobile app) requests an access token from an OAuth
provider (e.g., Auth0), then includes the JWT token in the Authorization header when
calling microservices like GET /api/orders.
Microservices Microservices with .NET · Microservices
if the service has recovered. If it succeeds, it closes the circuit again; otherwise, it
remains open.
Tools:
libraries that implement the Circuit Breaker pattern.
Example:
breaker opens, preventing overloading the service and allowing the system to fail
gracefully.
Microservices Microservices with .NET · Microservices
that the architecture remains loosely coupled and scalable.
Example: In an E-commerce system, instead of updating an "Order" record in the
database, you store each event like OrderCreated, PaymentProcessed, etc., and replay
these events to determine the current state of the order.
Microservices Deployment & CI/CD
Microservices Microservices with .NET · Microservices
tracing, and logging, helping you track and troubleshoot service interactions.
Microservices Microservices with .NET · Microservices
fallbacks in a microservices environment.
Example: In a Payment Service, if a payment request to an external provider fails, a
fallback could be to use an alternative payment gateway.
Follow :
Microservices Microservices with .NET · Microservices
schemas and enforce rules on backward and forward compatibility.
Microservices Microservices with .NET · Microservices
Review the concept and prepare a concise verbal explanation with a real project example.
Microservices Microservices with .NET · Microservices
which can lead to duplication of data across services. This introduces challenges in
keeping data synchronized between services, especially in the case of failures.
Microservices Microservices with .NET · Microservices
latency help identify performance degradation.