🚀 Day 40 : Debugging, Docker & Microservices Learnings Today was one of those deep technical days where everything that can break, does break — and you learn the most. I worked on a MERN-based microservices monorepo setup, dealing with services like API Gateway, Auth, User, Order, and Notification services, all containerized using Docker. 🧩 Key challenges I faced: Turborepo infinite loop issue due to missing workspace configuration Docker containers not reflecting code changes in real-time TypeScript + Express setup errors in service communication Debugging multi-service orchestration issues using Docker Compose 🔧 What I learned: Proper workspace configuration (like pnpm-workspace.yaml) is critical in monorepos Docker caching can be tricky — sometimes rebuilds don’t reflect changes unless handled correctly Microservices debugging is less about single-service logic and more about system-level thinking Small misconfigurations can cascade into large system failures Every bug today added a new layer of understanding about distributed system design, containerization, and monorepo architecture. #SoftwareDevelopment #FullStackDevelopment #MERNStack #Microservices #Docker #DevOps #BackendDevelopment #SystemDesign #NodeJS #TypeScript #CloudComputing #Programming #WebDevelopment #TechLearning #Debugging #Monorepo #Turborepo
Debugging MERN Microservices with Docker and Turborepo
More Relevant Posts
-
🚨 𝐌𝐲 𝐊𝐮𝐛𝐞𝐫𝐧𝐞𝐭𝐞𝐬 𝐩𝐨𝐝 𝐤𝐞𝐩𝐭 𝐫𝐞𝐬𝐭𝐚𝐫𝐭𝐢𝐧𝐠 𝐞𝐯𝐞𝐫𝐲 𝐟𝐞𝐰 𝐡𝐨𝐮𝐫𝐬… 𝐚𝐧𝐝 𝐈 𝐡𝐚𝐝 𝐧𝐨 𝐜𝐥𝐮𝐞 𝐰𝐡𝐲. No errors in the logs. No crash messages. Everything looked normal. Still… the pod kept disappearing. 𝐎𝐮𝐭 𝐨𝐟 𝐜𝐮𝐫𝐢𝐨𝐬𝐢𝐭𝐲, 𝐈 𝐫𝐚𝐧: kubectl describe pod <pod-name> And found the real reason: 💥 𝐎𝐎𝐌𝐊𝐢𝐥𝐥𝐞𝐝 (𝐄𝐱𝐢𝐭 𝐂𝐨𝐝𝐞 137) That’s when it hit me, the application wasn’t crashing… Kubernetes was killing it due to memory exhaustion. 𝐇𝐞𝐫𝐞’𝐬 𝐰𝐡𝐚𝐭 𝐈 𝐢𝐝𝐞𝐧𝐭𝐢𝐟𝐢𝐞𝐝 👇 1️⃣ 𝐍𝐨 𝐦𝐞𝐦𝐨𝐫𝐲 𝐥𝐢𝐦𝐢𝐭𝐬 𝐝𝐞𝐟𝐢𝐧𝐞𝐝 The pod was allowed to consume unlimited memory. Eventually, it exhausted the node’s memory and got terminated. 👉 𝐅𝐢𝐱: 𝐀𝐥𝐰𝐚𝐲𝐬 𝐝𝐞𝐟𝐢𝐧𝐞 𝐫𝐞𝐬𝐨𝐮𝐫𝐜𝐞 𝐫𝐞𝐪𝐮𝐞𝐬𝐭𝐬 𝐚𝐧𝐝 𝐥𝐢𝐦𝐢𝐭𝐬 𝘳𝘦𝘴𝘰𝘶𝘳𝘤𝘦𝘴: 𝘳𝘦𝘲𝘶𝘦𝘴𝘵𝘴: 𝘮𝘦𝘮𝘰𝘳𝘺: "256𝘔𝘪" 𝘭𝘪𝘮𝘪𝘵𝘴: 𝘮𝘦𝘮𝘰𝘳𝘺: "512𝘔𝘪" 2️⃣ 𝐉𝐕𝐌 𝐰𝐚𝐬 𝐧𝐨𝐭 𝐜𝐨𝐧𝐭𝐚𝐢𝐧𝐞𝐫-𝐚𝐰𝐚𝐫𝐞 The Java application calculated heap size based on the node’s total memory, not the container limit. 👉 𝐅𝐢𝐱: 𝐓𝐮𝐧𝐞 𝐉𝐕𝐌 𝐟𝐨𝐫 𝐜𝐨𝐧𝐭𝐚𝐢𝐧𝐞𝐫 𝐞𝐧𝐯𝐢𝐫𝐨𝐧𝐦𝐞𝐧𝐭𝐬 -𝘟𝘟:+𝘜𝘴𝘦𝘊𝘰𝘯𝘵𝘢𝘪𝘯𝘦𝘳𝘚𝘶𝘱𝘱𝘰𝘳𝘵 -𝘟𝘟:𝘔𝘢𝘹𝘙𝘈𝘔𝘗𝘦𝘳𝘤𝘦𝘯𝘵𝘢𝘨𝘦=75.0 3️⃣ 𝐌𝐞𝐦𝐨𝐫𝐲 𝐥𝐞𝐚𝐤 𝐢𝐧 𝐭𝐡𝐞 𝐚𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧 Even after setting limits, memory usage kept increasing over time. Root cause: A background process was holding objects and not releasing them. 👉 Fix: Monitor memory trends using Prometheus and Grafana If memory steadily increases and doesn’t drop, it’s likely a memory leak. 💡 𝑲𝒆𝒚 𝒕𝒂𝒌𝒆𝒂𝒘𝒂𝒚𝒔: • Always define memory requests and limits • Make your application container-aware • Monitor trends, not just logs • OOMKilled = container terminated by the system, not an app crash This is one of the most common (and confusing) issues in Kubernetes. Have you faced something similar? 𝑾𝒐𝒖𝒍𝒅 𝒍𝒐𝒗𝒆 𝒕𝒐 𝒉𝒆𝒂𝒓 𝒉𝒐𝒘 𝒚𝒐𝒖 𝒅𝒆𝒃𝒖𝒈𝒈𝒆𝒅 𝒊𝒕 👇 #Kubernetes #DevOps #K8s #CloudNative #SRE #PlatformEngineering
To view or add a comment, sign in
-
-
Most developers know how logging works in a local Spring Boot setup. But things get interesting when your application runs inside containers on Kubernetes. Here’s a simple breakdown of how Spring Boot logs become visible in HOLMES logs in a containerized environment: 1. A Spring Boot application (using Logback/Log4j) writes logs to standard output (console). 2. When the app is containerized using Docker, these logs are captured by the container runtime. 3. In a Kubernetes cluster, the container logs are managed by the node (via containerd or Docker runtime). 4. Kubernetes exposes these logs using: * kubectl logs * Logging agents (like Fluentd/Fluent Bit) 5. These agents forward logs to centralized systems like HOLMES (or ELK/Splunk). 6. HOLMES aggregates, indexes, and makes logs searchable for debugging and monitoring. Key takeaway: If your logs are not visible in HOLMES, don’t blame the tool immediately. Check the pipeline: Application → Container → Kubernetes → Log Agent → HOLMES One break in this chain = no visibility. Understanding this flow is critical when debugging production issues, especially in distributed systems. #SpringBoot #Kubernetes #Docker #Logging #Microservices #DevOps #ProductionDebugging #LovelyOnTech
To view or add a comment, sign in
-
-
In 2016, I mass-produced microservices like a factory. By 2017, I was debugging them at 2 AM on a Saturday. Here's what 14 years taught me about microservices the hard way: We had a monolith that "needed" to be broken up. So I split it into 23 microservices in 4 months. Result? - Deployment time went from 30 min to 3 hours - Debugging a single request meant checking 7 services - Team velocity dropped 40% - Every "simple" feature needed changes in 5+ repos The problem? I created a "distributed monolith." All the pain of microservices. None of the benefits. What I learned after fixing it: 1. Start with a well-structured monolith. Split only when you MUST. 2. Each service must own its data. Shared databases = shared pain. 3. If 2 services always deploy together, they should be 1 service. 4. Invest in observability BEFORE splitting. Tracing, logging, monitoring. 5. Domain boundaries matter more than tech stack choices. We consolidated 23 services down to 8. Deployment time dropped to 15 minutes. Team happiness went through the roof. The best architecture is the one your team can actually maintain. Have you ever over-engineered a system? What happened? #systemdesign #microservices #softwarearchitecture #java #programming
To view or add a comment, sign in
-
Docker —Why Every Developer Should Understand It One common problem in development: “It works on my machine… but not on yours.” Docker solves this. What is Docker? Docker is a tool that allows you to package your application along with all its dependencies into a container. This container can run anywhere — without worrying about environment differences. Why this matters: Different systems have different configurations. Different versions of libraries can break your app. Docker creates a consistent environment. What you can do with Docker: Run applications in isolated environments Share your project with zero setup issues Deploy applications more reliably Manage services like databases easily Real use case: Instead of installing Python, database, and dependencies manually… You run one command and everything works. Why developers use Docker: Consistency across environments Faster setup and deployment Easier collaboration Scalable system design Final thought: Docker is not just a tool for deployment. It’s a way to make your development predictable. Follow Saif Modan #Docker #DevOps #Backend #SoftwareDevelopment #Tech
To view or add a comment, sign in
-
-
Built and published my SimpleTimeService – End-to-End DevOps Challenge 🚀 This project is more than a simple web app — it’s a complete DevOps workflow built to simulate production-style delivery. What’s included: 🔹 Minimal Python web application (FastAPI) 🔹 Secure Docker containerization (non-root, read-only filesystem) 🔹 Kubernetes deployment with probes, limits, and service exposure 🔹 Infrastructure provisioning with Terraform (AWS VPC + EKS) 🔹 CI/CD automation using GitHub Actions 🔹 Security scanning using Trivy 🔹 Automated Kubernetes manifest updates with immutable image tags Tech stack used: 🐳 Docker ☸️ Kubernetes (EKS) 🏗 Terraform ⚙️ GitHub Actions ☁️ AWS 🐍 FastAPI Pipeline flow: Code Push → Lint → Build → Test → Security Scan → Push Image → Update Manifest → Deploy Production practices implemented: ✅ Non-root container execution ✅ Read-only filesystem ✅ Resource requests & limits ✅ Liveness & readiness probes ✅ Vulnerability scanning ✅ Immutable image versioning ✅ Infrastructure as Code GitHub repo live now 💻 https://lnkd.in/gANtZR8V #DevOps #AWS #Kubernetes #Terraform #Docker #GitHubActions #EKS #CloudNative #PlatformEngineering #DevSecOps
To view or add a comment, sign in
-
-
I recently explored some important Docker container patterns and how they are used in real-world system design. I learned these concepts by watching a video by Piyush Garg, and it really clarified a lot of things for me. Here are the key takeaways: • Sidecar Pattern: Runs a helper container alongside the main app to handle supporting tasks like logging, monitoring, or syncing • Adapter Pattern: Acts as a bridge to transform or standardize output so different systems can work together smoothly • Ambassador Pattern: Works as a proxy to manage communication between the app and external services like databases or APIs • Work Queue Pattern: Distributes tasks across multiple workers using a queue system to handle background jobs efficiently • Init Pattern: Executes setup tasks before the main container starts to ensure the environment is ready #docker #containers #devops #microservices #backenddevelopment #softwareengineering #cloudcomputing #kubernetes #systemdesign #architecture #fullstackdeveloper #webdevelopment #programming #coding #nodejs #reactjs #scalability #distributed systems #learning #developerlife #tech #engineering #softwaredeveloper #cloud #automation #ci #cd #buildinpublic #100daysofcode #codinglife #developers #techcommunity #programmers #learntocode #growthmindset #productivity #techskills #codingjourney #knowledge #innovation #futuretech #learninginpublic #devcommunity #softwarearchitecture #cloudnative #modernapps #containersystem #devopslife #backend #frontend
To view or add a comment, sign in
-
-
🏗️ Microservices vs Monolith — Which Should You Choose? This is one of the most debated topics in software architecture. Here's my honest take after working on both 🔵 Choose Microservices when: 📈 You need to scale independently Scale only the services under heavy load — not the entire application. 👥 You have large teams Each squad owns, deploys, and maintains their own service. No stepping on each other's toes. 🔧 You need different tech per service Use C# for one service, Node.js for another — best tool for each job. ❌ Downside: High complexity. Network calls, distributed tracing, and a heavy DevOps burden. Not for the faint-hearted. 🟣 Choose Monolith when: 🚀 You're at an early stage Ship fast, validate your idea, then optimize. Don't over-engineer before you have users. 👤 You have a small team Less infrastructure means more focus on building features that matter. 🐛 You want easier debugging Everything is in one place — no distributed complexity to trace through. ❌ Downside: One bottleneck slows the entire application. Harder to scale as you grow. 💡 My take: Start with a well-structured Monolith. Move to Microservices only when you have a real scaling problem — not an imaginary one. Which architecture do you use at work? #SoftwareArchitecture #Microservices #BackendDevelopment #CSharp #DotNet #SoftwareEngineering #Programming
To view or add a comment, sign in
-
-
You don't have a scaling problem. You have a premature optimisation problem. Most apps will never need: → Kafka → Kubernetes → Microservices → A distributed cache A single Postgres instance handles millions of rows just fine. Build boring. Scale when the pain is real - not when it feels cool. #SystemDesign #SoftwareEngineering #BackendDev #DevLife #Programming
To view or add a comment, sign in
-
-
I am glad to share a recent project I co-developed from scratch: j-kube-watch. It is a custom Kubernetes Operator designed to streamline cluster monitoring and eliminate alert fatigue. When monitoring Kubernetes environments, repetitive warnings like a CrashLoopBackOff or a failing probe can easily flood notification channels. To solve this, we built an operator that actively watches Pod lifecycle events and routes them intelligently. Key technical aspects of the project include: ● Built with Java 21 and the Fabric8 client, utilizing Virtual Threads for lightweight, concurrent event processing. ● An intelligent deduplication engine using Caffeine cache to suppress alert storms, sending grouped summaries instead of redundant notifications. ● Fully native configuration using Custom Resource Definitions (CRDs) for routing alerts to external channels like email. ● Packaged completely with Helm to handle deployments, RBAC rules, and network policies. This project was fully co-developed from start to finish in collaboration with Adham Ayad. You can find the full source code, architecture flow, and Helm charts on GitHub here: https://lnkd.in/dYJzZPZ5 Feedback and code reviews are always welcome. #Kubernetes #DevOps #Java #CloudNative #PlatformEngineering #Helm #Automation #ITI
To view or add a comment, sign in
-
-
🚀 Built k8s-debug – a lightweight CLI to reduce Kubernetes pod debugging time In large-scale microservices architectures, where hundreds of pods run across namespaces, identifying failing vs healthy pods quickly becomes noisy and time-consuming. Debugging often turns into repetitive kubectl commands, scattered logs, and delayed root cause identification — especially during incidents. To simplify this, I built k8s-debug 👇 What it helps surface quickly: • CrashLoopBackOff patterns • Failed / unhealthy pods across services • Termination reasons • Namespace-level pod health overview Instead of manually filtering and scanning outputs, this gives a clear, aggregated view of failing vs running pods in one place. Goal: Reduce time-to-diagnosis (MTTR) and improve observability during high-pressure scenarios. ⚡ Install: pip install k8s-debug-tool Run: k8s-debug --namespace <your-namespace> 📦 PyPI: https://lnkd.in/gNn44_Rs 💻 GitHub: https://lnkd.in/giYkPH_6 This is an early version, currently tested in a Kubernetes test environment. Planning to extend it with deeper diagnostics and real-time insights. Would appreciate feedback from engineers managing large-scale Kubernetes workloads #DevOps #Kubernetes #SRE #Microservices #CloudEngineering #Python #OpenSource #Automation
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development