Search This Blog

Sunday, September 21, 2025

Q31-Q35

Q31: What is pods and how it is related to Docker images and Docker containers?
Q32: What is the use of Compose Docker file?
Q33. What are the advantages and disadvantages of Docker and containers?
Q34. What are the advantages and disadvantages of microservices?
Q35:  What is API Gateway?

==========================================================================
Q31: What is pods and how it is related to Docker images and Docker containers?

Answer:
>> A Pod is the smallest deployable unit in Kubernetes.
>> It can contain one or more containers
>> All containers in a Pod share: Network namespace, Storage volumes, Lifecycle
>> Containers inside Pods are created from Docker images.
>> Kubernetes uses these images to deploy and manage containers at scale.

==========================================================================
Q32: What is the use of Compose Docker file?

Answer:



==========================================================================
Q33. What are the advantages and disadvantages of Docker and containers?

Answer:
Advantages:
1. Portability (Build once, run anywhere)
Containers include everything the app needs — libraries, configs, binaries — so the same image runs identically on a developer’s laptop, a test server, or Azure Kubernetes Service (AKS).

2. Lightweight and Fast
Containers share the host OS kernel instead of running their own OS like a VM.
Startup time: seconds, not minutes.
Memory footprint: far smaller than a VM.
This makes them excellent for microservices and serverless workloads.

3. Scalability
Containers work beautifully with orchestration platforms (like Kubernetes, AKS, ECS). You can horizontally scale easily — spin up or down containers as load changes.

4. Simplifies Microservices
Each microservice can be packaged independently, with its own dependencies and runtime. No “dependency hell” or version conflicts.

Disadvantages:
1. Complexity at Scale
Running one or two containers is easy. Running hundreds across nodes? You need orchestration (Kubernetes, Docker Swarm), which adds complexity in networking, storage, and monitoring.

2. Limited Isolation (Compared to VMs)
Containers share the same OS kernel. A kernel exploit could affect all containers.
Security-sensitive apps sometimes prefer full VM isolation.

3. Persistent Storage Challenges
Containers are stateless by design. Managing persistent volumes (for databases or file storage) is trickier — you must rely on external volumes or cloud storage.

4. Learning Curve
For teams new to DevOps, Dockerfiles, image registries, and orchestration can be intimidating. Proper governance, security, and tagging policies must be defined. 
==========================================================================
Q34. What are the advantages and disadvantages of microservices?

Answer:
Microservices usually have their own models and database. 

Advantages:
1. Independent Deployment – Each service can be developed, tested, and deployed separately without impacting the rest of the system. This enables faster releases and easier maintenance.

2. Scalability – You can scale only the services that need more resources (e.g., payment or search service) instead of scaling the whole application.

3. Technology Flexibility – Different microservices can use different technology stacks (.NET, Node.js, Python, etc.) based on what fits best.

4. Fault Isolation – A failure in one microservice usually doesn’t crash the entire system. Other services continue running, improving reliability.

5. Faster Development Cycles – Smaller, independent teams can work in parallel on different services, increasing productivity.

6. Better Alignment with DevOps & Cloud – Microservices fit naturally with CI/CD pipelines, containers (Docker), and orchestrators (Kubernetes), which helps in automation and continuous delivery.

Disadvantages:
1. Increased Complexity – You move from one large application to a distributed system. Managing multiple services, deployments, and dependencies is more complex.

2. Data Consistency Challenges – Each microservice typically has its own database, making transactions across services difficult. You often need patterns like Saga or eventual consistency.

3. Communication Overhead – Network calls replace local method calls, adding latency and requiring robust error handling and retry logic.

4. Difficult Testing & Debugging – End-to-end testing and debugging across multiple services can be hard, as you must trace requests through different components.

5. Higher Infrastructure Cost – Each service may require its own container, configuration, logging, and monitoring setup.

6. Steeper Learning Curve – Teams must understand distributed system design, observability, API versioning, and deployment automation.

==========================================================================
Q35. What is API Gateway?

Answer:
Api Gateway is a pattern we use in microservices architecture. It is a API management tool that sits between a client and a collection of backend services. An API gateway acts as a reverse proxy to accept all application programming interface (API) calls, aggregate the various services required to fulfill them, and return the appropriate result

==========================================================================

Q31-Q35

Q31: What is pods and how it is related to Docker images and Docker containers? Q32: What is the use of Compose Docker file? Q33. What are t...