3 425
Suscriptores
-124 horas
-117 días
-2430 días
Archivo de publicaciones
𝗢𝗽𝘁𝗶𝗺𝗶𝘀𝗲 𝗬𝗼𝘂𝗿 𝗗𝗼𝗰𝗸𝗲𝗿 𝗪𝗼𝗿𝗸𝗳𝗹𝗼𝘄 🚀💻
Supercharge your Docker skills with these key commands:
𝟭. 𝗿𝘂𝗻: Launch containers from images.
𝟮. 𝘀𝘁𝗼𝗽: Gracefully halt running containers.
𝟯. 𝘀𝘁𝗮𝗿𝘁: Revitalize stopped containers.
𝟰. 𝗲𝘅𝗲𝗰: Execute commands within containers.
𝟱. 𝗽𝗼𝗿𝘁: Identify a container's public-facing port.
𝟲. 𝗿𝗲𝗻𝗮𝗺𝗲: Give containers new identities.
𝟳. 𝗽𝗮𝘂𝘀𝗲/𝘂𝗻𝗽𝗮𝘂𝘀𝗲: Suspend/resume container processes.
𝟴. 𝗸𝗶𝗹𝗹: Halt running containers.
𝟵. 𝗯𝘂𝗶𝗹𝗱: Create custom Docker images.
𝟭𝟬. 𝘁𝗼𝗽: Display running processes of a container.
𝟭𝟭. 𝗰𝗽: Copy files between containers and local system.
𝟭𝟮. 𝗿𝗺: Remove stopped containers.
𝟭𝟯. 𝘀𝘁𝗮𝘁𝘀: Monitor real-time container resource usage.
𝟭𝟰. 𝗽𝘀: View container processes.
𝟭𝟱. 𝗵𝗶𝘀𝘁𝗼𝗿𝘆: View image evolution history.
𝟭𝟲. 𝗶𝗺𝗮𝗴𝗲 𝗹𝘀: List available Docker images.
𝟭𝟳. 𝗹𝗼𝗴𝘀: Retrieve and analyze container logs.
𝟭𝟴. 𝘃𝗲𝗿𝘀𝗶𝗼𝗻: Check Docker version.
𝟭𝟵. 𝗶𝗻𝗳𝗼: Fetch crucial Docker system information.
𝟮𝟬. 𝗶𝗻𝘀𝗽𝗲𝗰𝘁: Explore details of containers, images, networks.
CAP, BASE, SOLID, KISS, What do these acronyms mean?
The diagram below explains the common acronyms in system designs.
🔹 CAP
CAP theorem states that any distributed data store can only provide two of the following three guarantees:
1. Consistency - Every read receives the most recent write or an error.
2. Availability - Every request receives a response.
3. Partition tolerance - The system continues to operate in network faults.
🔹 BASE
The ACID (Atomicity-Consistency-Isolation-Durability) model used in relational databases is too strict for NoSQL databases. The BASE principle offers more flexibility, choosing availability over consistency. It states that the states will eventually be consistent.
🔹 SOLID
SOLID principle is quite famous in OOP. There are 5 components to it.
1. SRP (Single Responsibility Principle)
2. OCP (Open Close Principle)
3. LSP (Liskov Substitution Principle)
4. ISP (Interface Segregation Principle)
5. DIP (Dependency Inversion Principle)
🔹 KISS
"Keep it simple, stupid!" is a design principle first noted by the U.S. Navy in 1960. It states that most systems work best if they are kept simple.
𝟰 𝗧𝘆𝗽𝗲𝘀 𝗼𝗳 𝗡𝗼𝗦𝗤𝗟 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲𝘀 𝘄𝗶𝘁𝗵 𝗲𝘅𝗮𝗺𝗽𝗹𝗲𝘀:
[𝟭] 𝗗𝗼𝗰𝘂𝗺𝗲𝗻𝘁 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲𝘀
This is probably the most popular category of NoSQL databases.
Data is stored in JSON, BSON, or XML format.
A table is a collection of records. Records are known as documents
Documents can closely mimic the application domain object.
Examples - MongoDB, Couchbase, etc.
[𝟮] 𝗞𝗲𝘆 𝗩𝗮𝗹𝘂𝗲 𝗦𝘁𝗼𝗿𝗲𝘀
Each element is stored as a key-value pair.
It's similar to relational DB but with only two columns - key & value.
The value can be an object.
Examples - Redis, Dynamo
[𝟯] 𝗖𝗼𝗹𝘂𝗺𝗻-𝗢𝗿𝗶𝗲𝗻𝘁𝗲𝗱 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲𝘀
In RDBMS, Data is stored row by row.
But in Column-Oriented Database, data is stored as a set of columns.
More efficient for aggregation queries.
For example, find the total number of employees in a department.
Examples - MonetDB, Apache HBase
[𝟰] 𝗚𝗿𝗮𝗽𝗵 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲𝘀
Graph DBs deal with relationships between data elements.
Each element is a node and it is connected to other elements.
They support different data formats such as JSON and key-value.
Not used as commonly as Document or Key-Value storage.
Examples - Neo4J, Amazon Neptune.
👉 𝗪𝗵𝗲𝗻 𝘁𝗼 𝘂𝘀𝗲 𝘄𝗵𝗮𝘁 𝘁𝘆𝗽𝗲 𝗼𝗳 𝗡𝗼𝗦𝗤𝗟 𝗱𝗮𝘁𝗮𝗯𝗮𝘀𝗲?
✅ 𝗗𝗼𝗰𝘂𝗺𝗲𝗻𝘁 𝗗𝗕𝘀: Great for almost all types of applications that relied on SQL databases.
✅ 𝗞𝗲𝘆-𝗩𝗮𝗹𝘂𝗲: Shopping carts, user profiles & caching
✅ 𝗖𝗼𝗹𝘂𝗺𝗻-𝗢𝗿𝗶𝗲𝗻𝘁𝗲𝗱: Analytics and aggregation
✅ 𝗚𝗿𝗮𝗽𝗵: Map applications and knowledge graphs
MicroServices Best Practices
Microservices are all the rage in the software world, and for good reason. This architecture breaks down complex applications into smaller, independent services, leading to increased agility, scalability, and maintainability.
But how do you ensure your microservices are built like champions? Enter best practices. Here's a rundown of some key principles to keep in mind:
1️⃣ Single Responsibility:
Imagine a tiny, focused superhero instead of a jack-of-all-trades. That's the essence of single responsibility. Each microservice should do one thing and do it well. This makes them easier to understand, develop, test, and maintain.
2️⃣ Separate Data Stores:
Think of each microservice as a vault guarding its own treasure (data). Ideally, they should have dedicated data stores, like separate databases or NoSQL solutions. This isolates them from data issues in other services.
3️⃣ Asynchronous Communication: (but not hand-in-hand)
Let your microservices chat through email instead of holding hands across the network. Use asynchronous communication like message queues or pub-sub systems. This decouples services and makes the system more resilient.
4️⃣ Containerization:
Docker to the rescue! Containerization packages your microservices into neat, portable containers, ensuring consistent environments and simplifying deployment and scaling.
5️⃣ Orchestration: ️
Think of Kubernetes as the maestro of your container orchestra. It handles load balancing, scaling, and monitoring, making container management a breeze.
6️⃣ Build & Deploy Separation: ️
Imagine building a ship in a shipyard and then launching it from a separate port. That's the idea behind build and deploy separation. Keep these processes distinct to ensure smooth deployment across different environments.
7️⃣ Domain-Driven Design (DDD):
DDD helps you navigate the domain of your microservices. It defines clear boundaries and interactions between services, ensuring they align with your business capabilities.
8️⃣ Stateless is the Goal: ♀️
Think of microservices as Zen masters – unburdened by state. Store any necessary state in external data stores for easier scaling and maintenance.
9️⃣ Micro Frontends for Web Apps:
For web applications, consider the micro frontends approach. Break down the UI into independent components, allowing different teams to develop and deploy them faster.
Understand Docker in 3 Easy Steps 🚀
Docker provides 𝗹𝗶𝗴𝗵𝘁𝘄𝗲𝗶𝗴𝗵𝘁 𝘃𝗶𝗿𝘁𝘂𝗮𝗹𝗶𝘇𝗮𝘁𝗶𝗼𝗻 on your desktop using containers. Here's what happens when you "docker build", "docker pull", "docker run":
1. Docker Client talks to the Docker Daemon
2. Docker Daemon manages containers and images
3. Docker Registry stores images like on Docker Hub
When you "docker run" a container:
- Pull image from registry if not cached locally
- Create new container
- Give it a filesystem
- Connect to network
- Start container
Docker uses 𝗰𝗼𝗻𝘁𝗮𝗶𝗻𝗲𝗿𝗶𝘇𝗮𝘁𝗶𝗼𝗻, not hardware virtualization. Containers 𝘀𝗵𝗮𝗿𝗲 𝘁𝗵𝗲 𝗵𝗼𝘀𝘁 𝗸𝗲𝗿𝗻𝗲𝗹 so a full OS image isn't needed.
Docker 𝗶𝘀𝗼𝗹𝗮𝘁𝗲𝘀 𝗿𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀 with cgroups and namespaces without duplication. Containers get their own filesystem but don't duplicate the full OS.
The layered filesystems allow efficient use of storage and quick duplication of container environments.
Docker is a great 𝗽𝗮𝗰𝗸𝗮𝗴𝗶𝗻𝗴 𝘁𝗲𝗰𝗵𝗻𝗼𝗹𝗼𝗴𝘆 - bundling the app, libraries, dependencies - everything needed to run. This standardized packaging makes Docker images popular in the cloud, even when container runtimes like containerd or CRI-O are used instead of Docker itself.
So Docker provides lightweight virtualization on desktops, while also being an excellent packaging technology for apps in the cloud.
How to Deploy Your Microservice based application on Azure Kubernetes Service!
Looking to harness the power of microservices in the cloud? Azure Kubernetes Service (AKS) offers an ideal platform. Here's a snapshot of this architecture:
🎯AKS: Managed Kubernetes cluster hosted in Azure. Focus on agent nodes while Azure handles the Kubernetes API service.
🎯Virtual Network: AKS sets up a virtual network for agent nodes. For advanced scenarios, set up your own network with control over subnet config and more.
🎯Ingress: Exposes HTTP(S) routes to services within the cluster, acting as an API Gateway.
🎯Azure Load Balancer: Routes internet traffic to the ingress controller, ensuring scalability and reliability.
🎯External Data Stores: Microservices often use external data stores like Azure SQL Database or Azure Cosmos DB for stateful operations.
🎯Microsoft Entra ID: Used for creating and managing Azure resources and recommended for user authentication in client apps.
🎯Azure Container Registry: Store private Docker images for deployment. AKS can authenticate using its Microsoft Entra identity.
🎯Azure Pipelines: Part of Azure DevOps, automates builds, tests, and deployments. Also compatible with third-party CI/CD tools.
🎯Helm: A Kubernetes package manager that simplifies managing and deploying applications.
🎯Azure Monitor: Collects and stores metrics, logs, and telemetry data for monitoring, alerting, and root cause analysis.
🎯Cost Optimization: Use the Azure pricing calculator to estimate costs, and refer to the Azure Well-Architected Framework for further insights.
✨ Cost Considerations:
✅ AKS: No direct cost, but you pay for underlying resources.
✅ Azure Load Balancer: Charges for configured load-balancing rules.
✅ Azure Pipelines: Free options with charges for extra jobs.
✅ Azure Monitor: Costs based on data ingestion and retention.
