{"id":399,"date":"2026-11-03T12:01:36","date_gmt":"2026-11-03T12:01:36","guid":{"rendered":"https:\/\/www.codelogicx.com\/blog\/?p=399"},"modified":"2026-11-05T08:13:11","modified_gmt":"2026-11-05T08:13:11","slug":"demystifying-devops","status":"publish","type":"post","link":"https:\/\/www.codelogicx.com\/blog\/demystifying-devops\/","title":{"rendered":"Demystifying DevOps: A Practical Guide to Pipelines, Containers, and Runtime Environments"},"content":{"rendered":"<p><span data-contrast=\"auto\">This blog aims to provide <\/span><b><span data-contrast=\"auto\">DevOps Developers<\/span><\/b><span data-contrast=\"auto\"> with a clear and practical introduction to DevOps, covering its core principles, culture, tools, and workflows. It will explain how DevOps bridges the gap between development and operations, enables faster and more reliable software delivery, and helps developers adopt practices such as Continuous Integration (CI), Continuous Delivery (CD), automation, monitoring, and collaboration to build high-quality applications more efficiently.\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:210,&quot;335559739&quot;:210,&quot;335559740&quot;:300}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"1\">The Code to Production Gap<span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:480,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">A common conceptual hurdle for developers moving into full-stack or DevOps infrastructure is understanding how code translates from a local GitHub repository to a live, highly available production server. Modern applications for both frontend (FE) and backend (BE) are frequently written entirely in TypeScript. However, the mechanism by which they are deployed and executed in production couldn&#8217;t be more distinct.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Browsers cannot natively execute raw TypeScript, and servers cannot reliably run raw development processes without crashing. To bridge this gap, modern CI\/CD pipelines split deployment architectures into two distinct paradigms: The Build-and-Serve model for the frontend, and the Continuous Runtime model for the backend.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><i><span data-contrast=\"auto\">Let&#8217;s have a look at the Architectural Differences in TypeScript App Development!\u00a0\u00a0<\/span><\/i><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-404\" src=\"https:\/\/www.codelogicx.com\/blog\/wp-content\/uploads\/2026\/11\/figure1_architecture.png\" alt=\"\" width=\"1000\" height=\"520\" \/><\/p>\n<h2 aria-level=\"1\">Frontend Delivery: The Build-and-Serve Paradigm<\/h2>\n<p><span data-contrast=\"auto\">When deploying a frontend application (such as React, Vue, or Next.js static exports), we are not launching a persistent computational process on a cloud server. Instead, the deployment is entirely driven by a build sequence.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">During the CI\/CD pipeline, the TypeScript source code undergoes a compilation, minification, and bundling phase utilizing tools like Webpack, Vite, or Rollup. The pipeline strips away TypeScript typing and generates a finalized directory of highly optimized, static assets: HTML, CSS, and vanilla JavaScript. These static files are simply transferred to a web server (like Nginx) or a global Content Delivery Network (CDN, like AWS CloudFront or Vercel).<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p aria-level=\"1\"><b><span data-contrast=\"none\">Terminal Output: Frontend Build and Sync Execution<\/span><\/b><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:480,&quot;335559739&quot;:0}\">\u00a0<\/span><\/p>\n<p aria-level=\"1\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-405\" src=\"https:\/\/www.codelogicx.com\/blog\/wp-content\/uploads\/2026\/11\/1stTerminalSs.png\" alt=\"\" width=\"820\" height=\"284\" \/><\/p>\n<pre><b><span data-contrast=\"none\">FRONTEND DEPLOYMENT REALITY:\u00a0<\/span><\/b><span data-ccp-props=\"{&quot;335559685&quot;:144,&quot;335559738&quot;:80,&quot;335559739&quot;:80}\">\u00a0<\/span>\r\n\r\n<span data-contrast=\"none\">A deployed frontend application does not require a continuous running Node.js 'process' on the backend infrastructure. The server acts purely as a file host, handing the static JavaScript to the user's browser, where the actual execution and rendering occur locally.<\/span><\/pre>\n<h2 aria-level=\"1\">Backend Execution: The Continuous Runtime Paradigm<\/h2>\n<p><span data-contrast=\"auto\">Unlike the static frontend, a backend application (such as an Express, Fastify, or NestJS API) must actively listen for incoming HTTP requests, process intensive business logic, and broker connections to databases. Even though the backend is authored in TypeScript, it runs directly as executing code but it must be executed as JavaScript.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Because the standard Node.js runtime natively understands vanilla JavaScript, the deployment pipeline first transpiles the `.ts` files down to `.js` using compilers like `tsc` or `esbuild`. Once transpiled, the application is launched inside a server environment. This requires a persistent, long-lived process actively listening on a network socket (e.g., Port 3000).\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h2><span class=\"TextRun SCXW17002549 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW17002549 BCX8\" data-ccp-parastyle=\"heading 1\">Terminal Output: Backend <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW17002549 BCX8\" data-ccp-parastyle=\"heading 1\">Transpilation<\/span><span class=\"NormalTextRun SCXW17002549 BCX8\" data-ccp-parastyle=\"heading 1\"> Output<\/span><\/span><\/h2>\n<h2><span class=\"EOP Selected SCXW17002549 BCX8\" data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:480,&quot;335559739&quot;:0}\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-406\" src=\"https:\/\/www.codelogicx.com\/blog\/wp-content\/uploads\/2026\/11\/2ndTerminalSs.png\" alt=\"\" width=\"700\" height=\"240\" \/>\u00a0<\/span><\/h2>\n<h2 aria-level=\"1\">Sustaining the Backend: PM2 vs. Docker Containers<\/h2>\n<p><span data-contrast=\"auto\">To ensure a backend process remains continuously active, automatically restarts upon crashes, and survives server reboots, DevOps engineers leverage process management systems. The two dominant operational models are bare-metal execution via PM2, and containerized isolation via Docker.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-407\" src=\"https:\/\/www.codelogicx.com\/blog\/wp-content\/uploads\/2026\/11\/figure2_pm2_vs_docker.png\" alt=\"\" width=\"1000\" height=\"580\" \/><\/p>\n<h2 aria-level=\"1\">PM2 (Process Manager 2)\u00a0<span data-ccp-props=\"{}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">PM2 is a production process manager built for Node.js applications running directly on a host server&#8217;s operating system (such as Ubuntu or Amazon Linux). Executing an app via PM2 means running the JavaScript files natively on the host machine using the globally installed Node.js binary.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p aria-level=\"1\"><b><span data-contrast=\"none\">Terminal Output: PM2 Cluster Start and Status<\/span><\/b><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:480,&quot;335559739&quot;:0}\">\u00a0<\/span><\/p>\n<p aria-level=\"1\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-408\" src=\"https:\/\/www.codelogicx.com\/blog\/wp-content\/uploads\/2026\/11\/3rdTerminalSs.png\" alt=\"\" width=\"780\" height=\"284\" \/><\/p>\n<h3 aria-level=\"2\">The Node Runtime Clash Vulnerability:\u00a0<span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">The application relies entirely on the host server&#8217;s shared environment. For example, if you install Node.js v24 globally on your host machine to run a modern application but lately try to deploy a legacy application that explicitly requires Node v22, a runtime clash will occur. You cannot easily run both native Node versions simultaneously for different PM2 processes without implementing complex external version managers.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span data-ccp-props=\"{&quot;335559685&quot;:0,&quot;335559991&quot;:360}\">\u00a0<\/span><\/p>\n<h3 aria-level=\"2\">Environment Variable Injection (PM2):<\/h3>\n<p><span data-ccp-props=\"{&quot;335559685&quot;:360,&quot;335559991&quot;:360}\">\u00a0<\/span><span data-contrast=\"auto\">In a PM2 architecture, environment variables (like database passwords or API keys) are injected into the process at the exact moment the application starts. If an environment variable is updated (e.g., in a `.env` file), the application will not register automatically. You must execute a PM2 restart command (`pm2 reload api-prod`) for the new variables to be injected into the application&#8217;s memory.<\/span><span data-ccp-props=\"{&quot;335559685&quot;:0,&quot;335559991&quot;:360}\">\u00a0<\/span><\/p>\n<h2>B. Docker Containers<\/h2>\n<p><span data-contrast=\"auto\">Docker fundamentally reconstructs application execution. Instead of relying on the host server&#8217;s global environment, Docker packages the application code, the exact Node.js runtime version required, and all critical system-level OS dependencies into a single, immutable artifact known as a Container Image.<\/span><\/p>\n<p><span data-contrast=\"auto\"><span class=\"TextRun SCXW178817975 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW178817975 BCX8\" data-ccp-parastyle=\"heading 1\">Terminal Output: Docker Image Build and Container Execution<\/span><\/span><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-409\" src=\"https:\/\/www.codelogicx.com\/blog\/wp-content\/uploads\/2026\/11\/4thTerminalSs.png\" alt=\"\" width=\"780\" height=\"328\" \/><\/p>\n<h3 aria-level=\"2\">Absolute Node Runtime Isolation:<\/h3>\n<p><span data-ccp-props=\"{&quot;335559685&quot;:360,&quot;335559991&quot;:360}\">\u00a0<\/span><span data-contrast=\"auto\">A Docker container spins up as a deeply isolated mini environment. The container operates completely independently of the host server&#8217;s global Node version because it brings its own embedded runtime. For example, if your host server is running Node v24, but your containerized application requires Node v22, the Docker image simply bundles its own internal Node 22 runtime. The application will execute flawlessly inside the container, completely unaware of the Node v24 installation running outside on the host.<\/span><span data-ccp-props=\"{&quot;335559685&quot;:360,&quot;335559991&quot;:360}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;335559685&quot;:360,&quot;335559991&quot;:360}\">\u00a0<\/span>Environment Variable Injection (Docker):<\/p>\n<p><span data-ccp-props=\"{&quot;335559685&quot;:360,&quot;335559991&quot;:360}\">\u00a0<\/span><span data-contrast=\"auto\">Similar to PM2, Docker containers ingest environment variables strictly at startup (often passed via `-e` runtime flags or specific env files). However, because containers are immutable by design, you cannot simply &#8216;restart&#8217; the exact same container state to pick up new variables. To update environment variables in Docker, you must actively stop the existing container, destroy it, and spin up a brand-new container instance injecting the newly updated environment variables during boot.<\/span><span data-ccp-props=\"{&quot;335559685&quot;:360,&quot;335559991&quot;:360}\">\u00a0<\/span><\/p>\n<pre><span class=\"TextRun SCXW44882922 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW44882922 BCX8\">THE ARCHITECTURAL DIFFERENCE: <\/span><\/span><span class=\"TextRun SCXW44882922 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW44882922 BCX8\">PM2 manages your application process within the server's shared ecosystem. Docker manages the entire ecosystem alongside your application process, achieving total runtime isolation and <\/span><span class=\"NormalTextRun SCXW44882922 BCX8\">eliminating<\/span><span class=\"NormalTextRun SCXW44882922 BCX8\"> environmental drift.<\/span><\/span><\/pre>\n<h2 aria-level=\"1\">Observability: Application Logs vs. Flow Logs<\/h2>\n<p><span data-contrast=\"auto\">Deploying the application successfully is only the first phase. Once the application is live, developers must monitor two distinct layers of telemetry: the internal code execution (Application Logs) and the network traffic reaching the server (Flow Logs).\u00a0\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"1\">A. Application Logs (Internal Code Diagnostics)<\/h2>\n<p><span data-contrast=\"auto\">Application logs are generated directly by your code (e.g., `console.log()` or logging libraries like Winston\/Pino). Depending on your deployment strategy, you retrieve these logs differently:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p aria-level=\"1\"><b><span data-contrast=\"none\">Terminal Output: Fetching Application Logs (PM2 vs Docker)<\/span><\/b><\/p>\n<p aria-level=\"1\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-410\" src=\"https:\/\/www.codelogicx.com\/blog\/wp-content\/uploads\/2026\/11\/5thTerminalSs.png\" alt=\"\" width=\"900\" height=\"284\" \/><\/p>\n<h2 aria-level=\"1\">B. Network Flow Logs (Infrastructure Diagnostics)<\/h2>\n<p><span data-contrast=\"auto\">If your application is running, but users cannot reach it, application logs won&#8217;t help because the request never hits your code. This is where VPC Flow Logs (Virtual Private Cloud Flow Logs) become critical. Flow logs record all IP network traffic going to and from network interfaces in your cloud infrastructure (like AWS or GCP).<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">A flow log tells you the source IP, destination port, the protocol, and crucially, whether the firewall (Security Group) ACCEPTED or REJECTED the traffic.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p aria-level=\"1\"><b><span data-contrast=\"none\">Terminal Output: AWS VPC Flow Log Output Analysis<\/span><\/b><\/p>\n<p aria-level=\"1\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-411\" src=\"https:\/\/www.codelogicx.com\/blog\/wp-content\/uploads\/2026\/11\/6thTerminalSs.png\" alt=\"\" width=\"980\" height=\"262\" \/><\/p>\n<pre aria-level=\"1\"><span class=\"TextRun SCXW28264381 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW28264381 BCX8\">WHY FLOW LOGS MATTER: <\/span><\/span><span class=\"TextRun SCXW28264381 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW28264381 BCX8\">If a frontend application cannot reach the backend API, developers often check the backend code. <\/span><span class=\"NormalTextRun SCXW28264381 BCX8\">If the application logs are completely empty, check the Flow Logs!<\/span><span class=\"NormalTextRun SCXW28264381 BCX8\"> An 'ACCEPT' means the request reached the server; a 'REJECT' means the cloud <\/span><span class=\"NormalTextRun SCXW28264381 BCX8\">firewall<\/span><span class=\"NormalTextRun SCXW28264381 BCX8\"> blocked it before your code even knew it existed.<\/span><\/span><\/pre>\n<h2 aria-level=\"1\">Conclusion<\/h2>\n<p><span data-contrast=\"auto\">Mastering the deployment lifecycle empowers developers to engineer significantly more resilient systems. Recognizing that frontends are built into immutable static assets and served, while backends are transpiled to JavaScript and actively sustained as persistent processes, demystifies the CI\/CD pipeline. Furthermore, graduating from host-dependent managers like PM2 to isolated, immutable Docker containers and learning to diagnose issues across both application and network flow logs marks the definitive transition from basic server administration to advanced, cloud-native DevOps engineering.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Mastering the deployment lifecycle empowers developers to engineer significantly more resilient systems. Recognizing that frontends are built into immutable static assets and served, while backends are transpiled to JavaScript and actively sustained as persistent processes, demystifies the CI\/CD pipeline. Furthermore, graduation from host-dependent managers like PM2 to isolated, immutable D ker\u00a0\u00a0<\/span><\/p>\n<p aria-level=\"1\"><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:480,&quot;335559739&quot;:0}\">\u00a0<\/span><\/p>\n<p><span class=\"EOP Selected SCXW44882922 BCX8\" data-ccp-props=\"{&quot;335559685&quot;:144,&quot;335559738&quot;:80,&quot;335559739&quot;:80}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog aims to provide DevOps Developers with a clear and practical introduction to DevOps, covering its core principles, culture, tools, and workflows. It will explain how DevOps bridges the gap between development and operations, enables faster and more reliable software delivery, and helps developers adopt practices such as Continuous Integration (CI), Continuous Delivery (CD), &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.codelogicx.com\/blog\/demystifying-devops\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Demystifying DevOps: A Practical Guide to Pipelines, Containers, and Runtime Environments&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":414,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,1],"tags":[],"class_list":["post-399","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-startupx"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.codelogicx.com\/blog\/wp-json\/wp\/v2\/posts\/399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codelogicx.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codelogicx.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codelogicx.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codelogicx.com\/blog\/wp-json\/wp\/v2\/comments?post=399"}],"version-history":[{"count":4,"href":"https:\/\/www.codelogicx.com\/blog\/wp-json\/wp\/v2\/posts\/399\/revisions"}],"predecessor-version":[{"id":416,"href":"https:\/\/www.codelogicx.com\/blog\/wp-json\/wp\/v2\/posts\/399\/revisions\/416"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codelogicx.com\/blog\/wp-json\/wp\/v2\/media\/414"}],"wp:attachment":[{"href":"https:\/\/www.codelogicx.com\/blog\/wp-json\/wp\/v2\/media?parent=399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codelogicx.com\/blog\/wp-json\/wp\/v2\/categories?post=399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codelogicx.com\/blog\/wp-json\/wp\/v2\/tags?post=399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}