<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Iroro Chadere - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Iroro Chadere - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Thu, 21 May 2026 04:57:39 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/author/irorochad/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ A How to Start a Career in Site Reliability Engineering – SRE Career Guide ]]>
                </title>
                <description>
                    <![CDATA[ If you're considering a career in the Site Reliability Engineering (SRE) field, you should understand what SREs do, how to get started, and how to grow as an SRE.  In this article, we'll explore what you need to know to be an SRE, and how you can dev... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/start-a-career-in-site-reliability-engineering/</link>
                <guid isPermaLink="false">66baee8ca844cdf0b398b3f1</guid>
                
                    <category>
                        <![CDATA[ automation ]]>
                    </category>
                
                    <category>
                        <![CDATA[ performance ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Site Reliability Engineering ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Software Engineering ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Iroro Chadere ]]>
                </dc:creator>
                <pubDate>Fri, 05 Apr 2024 18:24:12 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/07/pexels-tauberman-128362.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you're considering a career in the Site Reliability Engineering (SRE) field, you should understand what SREs do, how to get started, and how to grow as an SRE. </p>
<p>In this article, we'll explore what you need to know to be an SRE, and how you can develop your skills to become a successful one.</p>
<h3 id="heading-heres-what-well-cover-in-this-article">Here's what we'll cover in this article:</h3>
<ol>
<li><a class="post-section-overview" href="#heading-introduction-to-site-reliability-engineering-sre">Introduction to Site Reliability Engineering</a></li>
<li><a class="post-section-overview" href="#role-and-responsibilities-of-an-sre-">Role and Responsibilities of an SRE</a></li>
<li><a class="post-section-overview" href="#heading-importance-of-sre-in-modern-tech-organizations">Importance of SRE in Modern Tech Organizations</a></li>
<li><a class="post-section-overview" href="#prerequisites-and-fundamental-knowledge-">Prerequisites and Fundamental Knowledge</a></li>
<li><a class="post-section-overview" href="#essential-skills-for-sre-&quot;">Essential Skills for SRE</a></li>
<li><a class="post-section-overview" href="#learning-path-and-resources-">Learning Path and Resources</a></li>
<li><a class="post-section-overview" href="#how-to-succeed-in-the-sre-field-">How to Succeed in the SRE Field</a></li>
<li><a class="post-section-overview" href="#conclusion-">Conclusion</a></li>
</ol>
<h3 id="heading-before-we-get-started">Before we get started...</h3>
<p>This isn't a course or a complete tutorial on how to master SRE – that is, <strong>it doesn't teach all the nitty-gritty</strong> of SRE. Instead, it's more like a guide that'll walk you through how to become an SRE by providing the needed materials for you to succeed. </p>
<p>To get started with reading this guide, you should have a desire to learn and become an SRE. SRE is a wide field, and I urge you to have a burning zeal to learn and master it. </p>
<p>Last but not least, keep in mind that the linked resources and additional pointers contained in this post are my <strong>personal recommendations</strong> that should help you as you dive into the SRE field. Just make sure you chose the ones that best match your learning style and goals.</p>
<h2 id="heading-introduction-to-site-reliability-engineering-sre">Introduction to Site Reliability Engineering (SRE)</h2>
<p>The concept of <a target="_blank" href="https://youtu.be/1NF6N2RwVoc">Site Reliability Engineering (SRE) originated at Google</a> in the early 2000s, emerging as a novel approach to tackling large-scale system management challenges. </p>
<p>SRE was born from the necessity to ensure the reliability and scalability of rapidly growing online services. And it has since evolved into a critical discipline within the tech industry. </p>
<p>This origin story not only highlights SRE's roots but also its foundational importance in shaping modern operational practices.</p>
<p>In the early days of Google, the explosive growth of its services and the scale at which they operated introduced unprecedented reliability and scalability challenges. </p>
<p>Traditional IT operations approaches were insufficient for the company's needs, prompting a rethink of how to manage large-scale systems efficiently and reliably. Google's innovative solution was to create a new role that blended software engineering with IT operations, thus giving birth to Site Reliability Engineering.</p>
<p>This new breed of engineers was tasked with making Google's already large and complex systems more reliable, efficient, and scalable. They applied software engineering principles and practices to infrastructure and operations problems, automating tasks that were traditionally performed manually. </p>
<p>This approach not only improved system reliability and efficiency but also allowed for scaling operations in a way that could keep up with the company's rapid growth.</p>
<h3 id="heading-definition-and-purpose-of-sre">Definition and Purpose of SRE</h3>
<p><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a4A3Ns3r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uoonngsuoz7pduffn17m.png" alt="An Image showing the conflicts between devs and ops team" width="600" height="400" loading="lazy"></p>
<p>Photo Credit: <a target="_blank" href="https://dev.to/techworld_with_nana/sre-and-tasks-of-an-sre-explained-3ah9"><em>TechWorld with Nana</em></a></p>
<p>After exploring its origins, you can see that SRE is fundamentally about applying a software engineering mindset to help solve operations problems.</p>
<p>At its core, SRE is about engineering resilience into systems and applications. It focuses on the intersection of software engineering and system administration, applying principles of software design to infrastructure and operations problems. </p>
<p>SRE aims to strike a balance between innovation and reliability, enabling organizations to deliver feature-rich products while maintaining high levels of service reliability.</p>
<p>The primary purpose of SRE is to build and maintain highly reliable, scalable, and efficient systems through a combination of software development, automation, and operational best practices. </p>
<p>By adopting a proactive and engineering-driven approach to operations, SRE teams strive to minimize service disruptions, mitigate risks, and optimize system performance.</p>
<h2 id="heading-role-and-responsibilities-of-an-sre">Role and Responsibilities of an SRE</h2>
<p>The role of an SRE is multifaceted, encompassing a wide range of responsibilities across software development, operations, and system architecture. </p>
<p>Some key responsibilities of an SRE include:</p>
<ul>
<li><strong>Service Reliability</strong>: Ensuring the reliability, availability, and performance of critical services and systems.</li>
<li><strong>Automation and Tooling</strong>: Developing automation tools and systems for provisioning, deployment, monitoring, and incident response.</li>
<li><strong>Capacity Planning</strong>: Analyzing resource usage patterns and forecasting capacity requirements to support business growth.</li>
<li><strong>Incident Management</strong>: Responding to and resolving incidents in a timely manner, and conducting post-incident reviews to identify root causes and prevent recurrence.</li>
<li><strong>Performance Optimization</strong>: Identifying and addressing performance bottlenecks to improve system scalability and efficiency.</li>
<li><strong>Security and Compliance</strong>: Implementing security best practices and ensuring compliance with regulatory requirements to protect sensitive data and infrastructure.</li>
<li><strong>Collaboration and Communication</strong>: Working closely with cross-functional teams, including software engineers, product managers, and system administrators, to drive continuous improvement and innovation.</li>
</ul>
<h3 id="heading-importance-of-sre-in-modern-tech-organizations">Importance of SRE in Modern Tech Organizations:</h3>
<p>In today's digital economy, where user expectations are higher than ever, the reliability and performance of online services are critical to business success. Downtime or poor performance can have significant financial and reputational consequences, leading to lost revenue, customer churn, and damage to brand reputation.</p>
<p>SRE plays a vital role in addressing these challenges by applying software engineering principles to infrastructure and operations. This improves system reliability, scalability, and efficiency. </p>
<p>By fostering a culture of reliability and resilience, SRE enables organizations to deliver better user experiences, reduce operational overhead, and drive business growth.</p>
<p>And as organizations increasingly rely on cloud computing, microservices architecture, and DevOps practices to innovate and scale their operations, the role of SRE becomes even more crucial. SRE provides the expertise and tools necessary to manage complex distributed systems effectively, enabling organizations to leverage technology to achieve their business objectives.</p>
<p>So as you can see, SRE is not just a technical discipline but a strategic imperative for modern tech organizations seeking to thrive in a highly competitive and dynamic market landscape. By investing in SRE principles and practices, organizations can build more resilient and reliable systems, driving innovation, growth, and customer satisfaction.</p>
<h2 id="heading-prerequisites-and-fundamental-knowledge">Prerequisites and Fundamental Knowledge</h2>
<p>If you're going to embark on a career in Site Reliability Engineering (SRE), you'll need a solid foundation in computer science principles, a good grasp of programming, and an understanding of version control systems. </p>
<p>These components equip aspiring SREs with the necessary tools to design, develop, and manage reliable and scalable systems.</p>
<h3 id="heading-understanding-of-computer-science-basics">Understanding of Computer Science Basics</h3>
<p><strong>Operating Systems Concepts</strong>: A deep understanding of operating systems (OS) is crucial for SREs. This knowledge includes, but is not limited to, process management, memory management, file systems, and the OS's role in defining the interactions between hardware and software. </p>
<p>🔗<a target="_blank" href="https://www.freecodecamp.org/news/an-introduction-to-operating-systems/">You can checkout this Handbook</a> that teaches you key OS concepts for Mac, Linux, and Windows.</p>
<p>Familiarity with these concepts helps SREs in optimizing system performance and in diagnosing and troubleshooting system-level issues.</p>
<p><strong>Networking Fundamentals</strong>: Networking is the backbone of the internet and cloud services, making it essential for SREs to understand the basics of networking. This includes 🔗<a target="_blank" href="https://www.freecodecamp.org/news/what-is-tcp-ip-layers-and-protocols-explained/">TCP/IP models</a>, <a target="_blank" href="https://www.freecodecamp.org/news/what-is-dns-for-beginners/">DNS</a>, HTTP, HTTPS, and network protocols, as well as the ability to diagnose network-related issues. </p>
<p>Here's a 🔗<a target="_blank" href="https://www.freecodecamp.org/news/computer-networking-how-applications-talk-over-the-internet/">solid introduction to computer networking basics</a> you can use to get started.</p>
<p>And here's a 🔗<a target="_blank" href="https://www.freecodecamp.org/news/http-full-course/">full handbook on HTTP Networking</a> for beginners.</p>
<p>A solid grasp of networking principles allows SREs to ensure that the services they manage can communicate efficiently and reliably across the internet and within distributed systems.</p>
<h3 id="heading-proficiency-in-programming-languages">Proficiency in Programming Languages</h3>
<p><strong>Recommended Languages (Python, Go, Java)</strong>: SREs must be proficient in at least one programming language. </p>
<p>Python is widely favored for its simplicity and the vast ecosystem of libraries, making it ideal for automation scripts and tools. </p>
<p>freeCodeCamp 🔗<a target="_blank" href="https://www.freecodecamp.org/learn/scientific-computing-with-python/">has a couple Python certifications</a> if you want to learn the basics and get some practice coding in Python.</p>
<p>Go, developed by Google, is becoming increasingly popular in cloud services and systems programming due to its efficiency and performance. </p>
<p>🔗<a target="_blank" href="https://www.freecodecamp.org/news/learn-go-by-building-11-projects/">Here's a full course</a> that'll teach you go by having you build 11 projects.</p>
<p>Java, known for its portability and extensive use in enterprise environments, is also valuable. </p>
<p>🔗<a target="_blank" href="https://www.freecodecamp.org/news/learn-the-basics-of-java-programming/">Here's a full course</a> that teaches you coding in Java, 🔗<a target="_blank" href="https://www.freecodecamp.org/news/the-java-handbook/">along with a handbook</a> to reinforce your skills.</p>
<p>Mastery of these languages enables SREs to write efficient, reliable software that automates and enhances system operations.</p>
<p><strong>Scripting Skills (for example, Shell Scripting)</strong>: Scripting skills are important for automating routine tasks, such as software deployment, system configuration, and monitoring. <a target="_blank" href="https://www.freecodecamp.org/news/shell-scripting-crash-course-how-to-write-bash-scripts-in-linux/">Shell scripting</a>, in particular, is essential for Unix/Linux-based systems. </p>
<p>🔗<a target="_blank" href="https://www.freecodecamp.org/news/bash-scripting-tutorial-linux-shell-script-and-command-line-for-beginners/">Here's a tutorial on bash scripting</a> that'll walk you through some examples.</p>
<p>These scripting skills save time, reduce the likelihood of human error, and ensure that operations can scale efficiently.</p>
<h3 id="heading-familiarity-with-version-control-systems-like-git">Familiarity with Version Control Systems (like Git)</h3>
<p>Version control is fundamental to modern software development and operations. Git, being the most widely used version control system, is crucial for tracking changes in code, collaboration, and maintaining the integrity of software projects. </p>
<p>Understanding Git workflows, branches, commits, and merges is essential for SREs, as it enables them to manage code changes, automate parts of the software delivery pipeline, and roll back changes if necessary.</p>
<p>🔗<a target="_blank" href="https://www.freecodecamp.org/news/gitting-things-done-book/">Here's a full book</a> that'll teach you everything you need to know (and more!) to get started with Git.</p>
<p>And 🔗<a target="_blank" href="https://www.freecodecamp.org/news/learn-git-basics/">here's a handbook</a> that'll review the common commands and actions you'll use in version control every day.</p>
<p>Together, these prerequisites form the foundation upon which SREs build their skills. Mastery of computer science fundamentals, programming, and version control is essential for anyone looking to succeed in the rapidly evolving field of Site Reliability Engineering.</p>
<h2 id="heading-essential-skills-for-sre">Essential Skills for SRE</h2>
<p><img src="https://assets-global.website-files.com/5c9200c49b1194323aff7304/60c87194fb2d0e404ca27073_Top_SRE-570x330.png" alt="An image showing &quot;settings&quot; icon init" width="1140" height="660" loading="lazy"></p>
<p><em>The image above is gotten from <a target="_blank" href="https://www.squadcast.com/blog/top-sre-toolchain-used-by-site-reliability-engineers">SquadCast</a></em></p>
<p>The realm of Site Reliability Engineering is both broad and deep. It encompasses a range of skills that ensure systems are not only reliable but also efficient, scalable, and responsive to the needs of users and businesses alike.</p>
<h3 id="heading-system-administration-and-operations">System Administration and Operations</h3>
<ul>
<li><strong>Knowledge of Linux/Unix Administration</strong>: Proficiency in managing and troubleshooting 🔗<a target="_blank" href="https://www.youtube.com/watch?v=ROjZy1WbCIA">Linux or Unix-based environment</a>s is fundamental. This includes managing file systems, users, processes, packages, and services.</li>
<li><strong>Network Administration</strong>: Understanding network configuration, firewall management, and network services ensures SREs can optimize network performance and security. 🔗<a target="_blank" href="https://www.coursera.org/articles/what-is-a-network-administrator-a-career-guide">Here's an article that explains Network Admin</a>.</li>
<li><strong>Resource Management</strong>: Efficient management of system resources, including CPU, memory, and disk IO, to ensure optimal performance and reliability.</li>
</ul>
<h3 id="heading-automation-and-infrastructure-as-code-iac">Automation and Infrastructure as Code (IaC)</h3>
<ul>
<li><strong>Automation Tools</strong>: Proficiency in tools like <a target="_blank" href="https://www.youtube.com/watch?v=h8MurJBJVNc">Ansible</a>, Chef, or Puppet for 🔗<a target="_blank" href="https://www.redhat.com/en/topics/devops/what-is-ci-cd#:~:text=CI%2FCD%2C%20which%20stands%20for,a%20shared%20source%20code%20repository.">automating deployment, configuration, and management tasks</a>.</li>
<li><strong>Infrastructure as Code</strong>: Using tools such as Terraform and CloudFormation to manage infrastructure through code, enabling scalable and reproducible environments with reduced human error. TerraForm is the most suitable and popular, and I recommend that you 🔗<a target="_blank" href="https://www.youtube.com/watch?v=l5k1ai_GBDE">check out this 15 minute intro</a>.</li>
<li><strong>Scripting and Coding</strong>: Ability to write scripts and small programs to automate tasks and integrate systems</li>
</ul>
<h3 id="heading-monitoring-and-alerting">Monitoring and Alerting</h3>
<ul>
<li><strong>Implementing Monitoring Tools</strong>: Experience with tools like 🔗<a target="_blank" href="https://prometheus.io/docs/prometheus/latest/getting_started/">Prometheus</a>, 🔗<a target="_blank" href="https://www.youtube.com/watch?v=w-c3KYKQQfs">Grafana</a>, ELK Stack, or Splunk for real-time monitoring of applications and infrastructure. There are a lot of tools to mange and monitor incidents, but the ones listed above are the most wildly used in the industry. </li>
<li><strong>Log Management and Analysis</strong>: Ability to aggregate, analyze, and interpret logs from various sources for insight into system behavior and troubleshooting.</li>
<li><strong>Alerting Strategies</strong>: Developing effective alerting mechanisms that accurately reflect system health and operational issues without overwhelming with false positives.</li>
</ul>
<h3 id="heading-incident-response-and-post-incident-analysis">Incident Response and Post-Incident Analysis</h3>
<ul>
<li><strong>Incident Management</strong>: Ability to lead and manage the response to system outages or performance degradations to restore service as quickly as possible.</li>
<li>🔗 <strong><a target="_blank" href="https://www.atlassian.com/incident-management/handbook/postmortems">Blameless Postmortems</a></strong>: Conducting thorough analysis post-incident to identify root causes without attributing blame, focusing instead on learning and improvement.</li>
<li><strong>Reliability Metrics</strong>: Tracking and improving key reliability metrics such as availability, latency, and error rates. 🔗 <a target="_blank" href="https://www.blameless.com/blog/6-software-reliability-metrics-that-matter">Here's an article from <em>Blameless</em> that explains more about reliability metrics</a>.</li>
</ul>
<h3 id="heading-capacity-planning-and-performance-management">Capacity Planning and Performance Management</h3>
<ul>
<li><strong>Performance Tuning</strong>: After you've reviewed and gathered logs from your monitoring tools, it's a good idea to identify and optimise performance bottlenecks in applications and infrastructure.</li>
<li><strong>Scalability Strategies</strong>: Planning and implementing strategies for scaling systems to handle growth in users or data volume efficiently.</li>
<li><strong>Capacity Forecasting</strong>: Using metrics and trends to forecast future capacity needs and planning ahead to meet those requirements. Don't wait and hope the application won't go down – your task is to see into the future with the tools and skills you have to prevent it from going down.</li>
</ul>
<h3 id="heading-cloud-computing-concepts-and-technologies">Cloud Computing Concepts and Technologies</h3>
<ul>
<li><strong>Cloud Service Models</strong>: Understanding the spectrum of cloud services (🔗 <a target="_blank" href="https://www.ibm.com/topics/iaas-paas-saas">IaaS, PaaS, SaaS</a>) and how they can be leveraged for reliability and scalability.</li>
<li><strong>Cloud Providers</strong>: Familiarity with major cloud providers such as AWS, Google Cloud, and Azure, and their specific technologies and services.<br>🔗 <a target="_blank" href="https://www.youtube.com/watch?v=NhDYbskXRgc">Here's a 14 hour course to help you learn AWS</a>, 🔗 <a target="_blank" href="https://www.youtube.com/watch?v=m6ozQnqit50">a 4 hour course on Google Cloud</a>, and a 🔗 <a target="_blank" href="https://www.youtube.com/watch?v=jZx8PMQjobk">13 hour course on Azure</a> to get you on your feet!</li>
<li><strong>Cloud-Native Technologies</strong>: Knowledge of cloud-native technologies and practices, including 🔗 <a target="_blank" href="https://www.brightsidecodes.com/blog/understanding-microservices-and-api-gateway">microservices architecture</a>, <a target="_blank" href="https://www.freecodecamp.org/news/how-docker-containers-work/">containers</a> (for example, Docker), and orchestration tools (for example,  🔗 <a target="_blank" href="https://www.freecodecamp.org/news/the-kubernetes-handbook/">Kubernetes</a>), to build and manage scalable, resilient systems.  🔗 <a target="_blank" href="https://www.freecodecamp.org/news/learn-docker-and-kubernetes-hands-on-course/">This course</a> teaches you both Docker and Kubernetes basics.</li>
</ul>
<p>While all of these skills are vital, it isn't a must to master them, especially all at once. But knowing or having basic understanding of these essential skills enables SREs to ensure that systems are not just up and running, but also optimised for performance, ready to scale as needed, and resilient in the face of failures. </p>
<p>The role of an SRE demands a blend of expertise in software engineering and system operations, making it both a challenging and rewarding career path.</p>
<h2 id="heading-learning-path-and-resources"><strong>Learning Path and Resources</strong></h2>
<p>Like I said earlier in this article, this isn't a tutorial – it's more like a learning path that'll walk you through all that you need to get started in the SRE field. </p>
<p>The journey to becoming a proficient SRE is continuous and multifaceted. Engaging with a variety of resources and communities can significantly enhance your learning experience. </p>
<p>Below are some approaches and resources that you can use to learn or master the SRE field.</p>
<h3 id="heading-online-courses-and-tutorials">Online Courses and Tutorials</h3>
<ul>
<li><strong>Platforms like <a target="_blank" href="https://www.udemy.com/course/sre-bootcamp-builddeployrun-and-implement-observability/?couponCode=KEEPLEARNING">Udemy</a>, <a target="_blank" href="https://www.coursera.org/learn/site-reliability-engineering-slos">Coursera</a>, <a target="_blank" href="https://www.udacity.com/course/site-reliability-engineer-nanodegree--nd087">Udacity</a>, and <a target="_blank" href="https://www.edx.org/certificates/professional-certificate/ibm-site-reliability-engineering">edX</a></strong> offer comprehensive courses on SRE fundamentals, 🔗 <a target="_blank" href="https://www.simplilearn.com/tutorials/cloud-computing-tutorial">cloud computing</a>, 🔗 <a target="_blank" href="https://www.freecodecamp.org/news/automate-boring-tasks-no-code-automation-course/">automation</a>, and more. Look for courses developed in partnership with leading tech companies and universities.</li>
<li><strong>Specific Tutorials</strong> on tools and technologies (for example, 🔗 <a target="_blank" href="https://www.freecodecamp.org/news/learn-kubernetes-and-start-containerizing-your-applications/">Kubernetes</a>, 🔗 <a target="_blank" href="https://www.freecodecamp.org/news/how-to-use-terraform-to-deploy-a-site-on-google-cloud-platform/">Terraform</a>, Prometheus) abound on YouTube, or through the documentation and learning resources provided by the tools themselves. 🔗 <a target="_blank" href="https://www.freecodecamp.org/news/secure-server-infrastructure-clouds-using-falco-prometheus-grafana-and-docker/">Here's a fun tutorial that uses Prometheus</a> as part of a larger tech stack to secure server infrastructure clouds.</li>
</ul>
<h3 id="heading-books-and-publications">Books and Publications</h3>
<ul>
<li>🔗 S<a target="_blank" href="https://relyabilit.ie/">ite Reliability Engineering</a> by Niall Richard Murphy, Betsy Beyer, Chris Jones, and Jennifer Petoff (often referred to as the "SRE Bible"), published by O'Reilly, offers insights directly from Google's SRE team.</li>
<li>🔗 <a target="_blank" href="https://www.amazon.com/Phoenix-Project-DevOps-Helping-Business/dp/0988262592">The Phoenix Project</a> and 🔗 <a target="_blank" href="https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002">The DevOps Handbook</a> by Gene Kim, Jez Humble, and others provide excellent insights into DevOps principles, which overlap significantly with SRE practices. If you're a fan of books, then you can purchase those books to read. </li>
<li><strong>Industry Publications</strong> such as ACM Queue or 🔗 <a target="_blank" href="https://www.ieee.org/">IEEE</a> Software regularly feature articles on SRE topics, case studies, and best practices.</li>
</ul>
<h3 id="heading-hands-on-projects-and-exercises">Hands-On Projects and Exercises</h3>
<ul>
<li><strong>Cloud Platforms</strong> offer free tiers or trial periods that are perfect for experimenting with cloud-based infrastructure and services.</li>
<li><strong>GitHub and GitLab</strong> host a multitude of open-source projects where you can contribute code, documentation, or even participate in issue resolution and feature requests.</li>
<li><strong>Personal Projects</strong> can also serve as a valuable learning tool. Try to replicate real-world systems, or automate the deployment and management of an application from scratch. The best way to learn is to practice. </li>
<li><strong>Contributing to open-source projects</strong> related to SRE tools and technologies not only gives you hands-on experience but also helps you understand the community standards and practices. Open source is a great way to learn from others, improve your knowledge, and gain valuable experience. Think of working on an open source project like an entry-level job where you get to do real things! Contribute, contribute, contribute.</li>
</ul>
<p>Embarking on your SRE learning journey is both exciting and demanding. It requires a commitment to continuous learning and improvement. </p>
<p>Leveraging a mix of online resources, books, hands-on projects, community participation, and professional networking will equip aspiring SREs with the knowledge, skills, and insights needed to succeed in this dynamic field.</p>
<h2 id="heading-how-to-succeed-in-the-sre-field">How to Succeed in the SRE Field</h2>
<p>Navigating a successful career in Site Reliability Engineering (SRE) requires more than just technical acumen. You'll also need to cultivate a mindset geared towards growth, collaboration, and resilience. </p>
<p>Achieving success as an SRE involves a blend of continuous learning, adaptability, communication, problem-solving, and a commitment to fostering a culture of reliability.</p>
<h3 id="heading-continual-learning-and-skill-development">Continual Learning and Skill Development</h3>
<ul>
<li><strong>Stay Updated</strong>: The tech field evolves rapidly, with new tools, languages, and practices emerging constantly. Dedicate time regularly to learn new skills and technologies. Search through YouTube, LinkedIn and Twitter and connects with friends, folks and people who share the same goal and skills with you. </li>
<li><strong>Deepen and Broaden Your Knowledge</strong>: While specializing in certain areas is valuable, having a broad understanding of related disciplines, such as cloud services, networking, and cybersecurity, can significantly enhance your effectiveness as an SRE.</li>
</ul>
<h3 id="heading-adaptability-to-new-technologies-and-methodologies">Adaptability to New Technologies and Methodologies</h3>
<ul>
<li><strong>Be Open to Change</strong>: Embrace new methodologies and technologies. The willingness to adapt and experiment with innovative solutions is crucial in an environment where reliability and efficiency are paramount.</li>
<li><strong>Experimentation and Evaluation</strong>: Apply critical thinking to assess the applicability of new tools and practices to your organization's specific challenges and objectives.</li>
</ul>
<h3 id="heading-effective-communication-and-collaboration">Effective Communication and Collaboration</h3>
<ul>
<li><strong>Clear Communication</strong>: Whether it's documenting an incident report, explaining a technical concept to a non-technical stakeholder, or writing code comments, clear communication is key.<br>🔗 <a target="_blank" href="https://www.coursera.org/articles/communication-effectiveness">Here's an article I found that can help with some effect communication</a>. </li>
<li><strong>Collaborative Mindset</strong>: SRE involves working closely with development, operations, and business teams. Building strong relationships based on trust and mutual respect is essential for achieving common goals.<br>🔗 <a target="_blank" href="https://www.linkedin.com/advice/1/how-can-software-developers-build-strong-relationships-ipv4c">Here's some killer advice from LinkedIn</a> that can help.</li>
</ul>
<h3 id="heading-problem-solving-and-troubleshooting-skills">Problem-Solving and Troubleshooting Skills</h3>
<ul>
<li><strong>Analytical Approach</strong>: Develop a methodical approach to troubleshooting and problem-solving. This includes breaking down complex systems into smaller components, identifying potential failure points, and systematically eliminating possibilities.</li>
<li><strong>Learning from Failures</strong>: Adopt a mindset that views failures as learning opportunities. Conduct blameless postmortems to understand what went wrong and how similar incidents can be prevented in the future.</li>
</ul>
<h3 id="heading-embracing-a-culture-of-reliability-and-resilience">Embracing a Culture of Reliability and Resilience</h3>
<ul>
<li><strong>Prioritize Reliability</strong>: Advocate for reliability and uptime within your organization, emphasizing that reliability is a feature not just for customers but for the business's bottom line.</li>
<li><strong>Resilience Engineering</strong>: Focus on building systems that are not only reliable under normal conditions but can also gracefully handle unexpected stressors and failures. This involves designing for failure, anticipating bottlenecks, and implementing fallback mechanisms. 🔗 <a target="_blank" href="https://devops.com/what-is-resilience-engineering/">Check out this article</a> to learn more about Resilience Engineering.</li>
</ul>
<p>Success in the SRE field is about more than just keeping the systems running. You'll also need to foresee potential issues, enhance system resilience, and ensure that the infrastructure can support the organization's long-term goals. </p>
<p>By focusing on continual learning, adaptability, communication, problem-solving, and a culture of reliability, you can contribute significantly to your team and organization, while also advancing your career in this dynamic and critical field. </p>
<p>If for some reasons you're still lost in this SRE thing, you can connect with me on <a target="_blank" href="https://www.linkedin.com/in/irorochadere/">LinkedIn</a> or <a target="_blank" href="https://twitter.com/iroro_chad">Twitter</a> where I'll be sharing some news, info, and updates about trending SRE topics and discussions. </p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In this guide, we've journeyed through the essentials of what it takes to embark on a career in SRE. You should now understand its foundational principles and know how to acquire the necessary skills to excel in the role and make a significant impact within tech organizations. </p>
<p>Here's a recap of what we covered:</p>
<h3 id="heading-key-points">Key Points</h3>
<ul>
<li><strong>Introduction to SRE</strong>: We started with the genesis of SRE at Google, outlining its purpose to bridge the gap between development and operations, emphasizing reliability, scalability, and operational efficiency.</li>
<li><strong>Prerequisites and Fundamental Knowledge</strong>: A strong foundation in computer science principles, programming languages, and version control is essential for aspiring SREs.</li>
<li><strong>Essential Skills for SRE</strong>: We delved into system administration, automation, monitoring, incident response, and cloud computing as critical skills for anyone in the SRE domain.</li>
<li><strong>Learning Path and Resources</strong>: The path to becoming an SRE involves continuous learning through online courses, books, hands-on projects, and community engagement.</li>
<li><strong>Succeeding in the SRE Field</strong>: Success hinges on continual learning, adaptability, effective communication, problem-solving skills, and fostering a culture of reliability and resilience.</li>
</ul>
<h3 id="heading-pursue-sre-as-a-career-path">Pursue SRE as a Career Path</h3>
<p>Site Reliability Engineering is a mindset and a set of practices that can lead to highly rewarding careers. As businesses increasingly rely on technology, the demand for people who can ensure systems are reliable, scalable, and efficient has never been higher. </p>
<p>Pursuing a career in SRE offers the opportunity to work at the forefront of technology innovation, solving complex problems and making a tangible impact on the digital landscape.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Build a Custom API Gateway with Node.js ]]>
                </title>
                <description>
                    <![CDATA[ In the era of microservices, where applications are divided into smaller, independently deployable services, managing and securing the communication between these services becomes crucial. This is where an API gateway comes into play.  An API gateway... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/build-a-custom-api-gateway-with-node-js/</link>
                <guid isPermaLink="false">66baee892c1f85b4545c8bf4</guid>
                
                    <category>
                        <![CDATA[ api ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Microservices ]]>
                    </category>
                
                    <category>
                        <![CDATA[ node js ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Iroro Chadere ]]>
                </dc:creator>
                <pubDate>Fri, 08 Mar 2024 23:16:38 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/03/Building-custom-API-gateway.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>In the era of <a target="_blank" href="https://www.brightsidecodes.com/blog/understanding-microservices-and-api-gateway">microservices</a>, where applications are divided into smaller, independently deployable services, managing and securing the communication between these services becomes crucial. This is where an API gateway comes into play. </p>
<p>An API gateway serves as a central entry point for all client requests. It provides various functionalities such as routing, load balancing, authentication, and rate limiting.</p>
<p>In this article, we’ll explore how you can build out a custom API gateway using Node.js.</p>
<h3 id="heading-heres-what-well-cover">Here's what we'll cover:</h3>
<ol>
<li><a class="post-section-overview" href="#heading-what-is-an-api-gateway">What is an API Gateway?</a></li>
<li><a class="post-section-overview" href="#heading-security-in-api-gateways">Security in API Gateways</a></li>
<li><a class="post-section-overview" href="#heading-how-to-build-a-custom-api-gateway-with-nodejs">How to Build a Custom API Gateway with Node.js</a></li>
<li><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></li>
</ol>
<h3 id="heading-prerequisites">Prerequisites</h3>
<p>This is a beginner's guide that should be relatively easy to follow. But to fully understand and get the most out of it, basic knowledge of <a target="_blank" href="https://nodejs.org/">Node.js</a> such as installation, setting up, and spinning up a server is vital. </p>
<p>Without further ado, let's dig in!</p>
<h2 id="heading-what-is-an-api-gateway">What is an API Gateway?</h2>
<p>API gateways act as intermediaries between clients and back-end services in a Microservices architecture. They abstract the complexity of the underlying services and expose a unified API to clients. </p>
<p>By consolidating multiple service endpoints into a single entry point, API gateways simplify client-side code and improve the overall scalability and performance of the system.</p>
<p>Compared to other popular API gateway solutions like Kong, AWS API Gateway, and Tyke, building a custom API gateway using Node.js offers flexibility and customization options tailored to your specific project requirements.</p>
<p>To get a little more understanding of what an API gateway is, I recommend you <a target="_blank" href="https://www.brightsidecodes.com/blog/understanding-microservices-and-api-gateway">check out this article</a> if you haven’t.</p>
<h3 id="heading-benefits-of-using-an-api-gateway">Benefits of Using an API Gateway:</h3>
<ul>
<li><strong>Improved scalability and performance through request routing and load balancing:</strong> API gateways facilitate request routing and load balancing, distributing incoming traffic across multiple backend services to ensure optimal performance and scalability.</li>
<li><strong>Simplified client-side code by providing a unified API endpoint</strong>: With a unified API endpoint provided by the API gateway, clients can interact with multiple services seamlessly, reducing complexity and improving the maintainability of client-side code.</li>
<li><strong>Enhanced Security</strong>: API gateways offer robust security features such as authentication, authorization, and rate limiting, protecting backend services from unauthorized access and potential security threats.</li>
</ul>
<h2 id="heading-security-in-api-gateways">Security in API Gateways</h2>
<p>Security is paramount in modern software development, especially when dealing with distributed systems and microservices. API gateways play a crucial role in enforcing security measures to safeguard sensitive data and prevent unauthorized access to APIs.</p>
<p>Common security features implemented in API gateways include:</p>
<ul>
<li>JWT Authentication: Verifying the identity of clients using JSON Web Tokens (JWT) to ensure secure communication between clients and backend services.</li>
<li>OAuth2 Integration: Providing secure access control and authorization mechanisms using OAuth2 protocols to authenticate and authorize client requests.</li>
<li>SSL Termination: Encrypting traffic between clients and the API gateway using SSL/TLS protocols to protect data in transit from eavesdropping and tampering.</li>
</ul>
<p>Now you should have a general overview of what an API gateway is and why it's important.</p>
<p>In the next section, we will delve into the process of building a custom API gateway using Node.js. I'll demonstrate how to implement security features using the http-proxy-middleware package.</p>
<h2 id="heading-how-to-build-a-custom-api-gateway-with-nodejs">How to Build a Custom API Gateway with Node.js</h2>
<p>As I've already discussed, we'll be using Node.js for this tutorial. In my opinion, Node.js is by far the easiest and most popular web framework. Anyone can learn how to use it.</p>
<p>For this guide, I assume you already know or have a basic understanding of Node.js and how to set up a server.</p>
<h3 id="heading-getting-started-installations-and-setup">Getting Started – Installations and Setup</h3>
<p>To get started, create a new folder called “API-gateway” entirely outside your front-end or your back-end code. Once the folder is created, open it on your terminal and run <code>npm init -y</code>. This will set up <code>npm</code> and then you’re ready to roll things out!</p>
<p>We’ll be using a couple of NPM packages, and it’s best to install them now. The most important one is the <code>http-proxy-middleware</code>. This middleware or package is what will route our requests from one endpoint (www.domain.com/auth ) to each corresponding endpoint (www.externaldomain.com/v1/bla/auth, www.externaldomain.com/v1/bla/projects ) as defined in our microservices.</p>
<p>To install the http-proxy-middleware, simply run <code>npm i http-proxy-middleware</code> on the root folder on your terminal. If it's installed, you’re good to go.</p>
<p>Next, we’ll need the remaining packages. Simply run <code>npm install express cors helmet morgan</code> on your terminal in the root folder of the API gateway. </p>
<p>The above command installs the following:</p>
<ul>
<li><strong>Express</strong>: our Node.js library for creating our server and running our code</li>
<li><strong>Cors</strong>: middleware to manage and control any cross-origin requests</li>
<li><strong>Helmet</strong>: yet another middleware for securing our HTTP response headers</li>
<li><strong>Morgan</strong>: a logging tool we can use to track both success and error logs</li>
</ul>
<p>Lastly, install Nodemon. This is a tool that spins up your server whenever you save a file using <code>npm install --save-dev nodemon</code>.</p>
<p>Now, go to your package.js file and update the scripts section. It should look like this:</p>
<pre><code><span class="hljs-string">"scripts"</span>: {
 <span class="hljs-string">"start"</span>: <span class="hljs-string">"node index.js"</span>,
 <span class="hljs-string">"dev"</span>: <span class="hljs-string">"nodemon index.js"</span>,
 <span class="hljs-string">"test"</span>: <span class="hljs-string">"echo \"Error: no test specified\" &amp;&amp; exit 1"</span>
},
</code></pre><p>To finally start testing things out, create a new file called index.js in that same api-gateway folder.  </p>
<p>If you get everything right, you should have the following files:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/03/Screenshot-from-2024-03-04-12-50-56.png" alt="Image" width="600" height="400" loading="lazy">
<em>An image showing the file structure of our code base</em></p>
<h3 id="heading-putting-it-all-together">Putting it All Together</h3>
<p>A good code practice is to break things down as much as possible into smaller components. </p>
<p>But for this guide, we’re going to break that rule and put all the code into that one <code>index.js</code> file we created from the steps above. We'll be doing it this way because having too many files and an overly complex set up here might be confusing, especially while you're learning how things work.</p>
<p>First thing first, open the index.js file you’ve created and paste the following code into it:</p>
<pre><code><span class="hljs-keyword">const</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">"express"</span>);
<span class="hljs-keyword">const</span> cors = <span class="hljs-built_in">require</span>(<span class="hljs-string">"cors"</span>);
<span class="hljs-keyword">const</span> helmet = <span class="hljs-built_in">require</span>(<span class="hljs-string">"helmet"</span>);
<span class="hljs-keyword">const</span> morgan = <span class="hljs-built_in">require</span>(<span class="hljs-string">"morgan"</span>);
<span class="hljs-keyword">const</span> { createProxyMiddleware } = <span class="hljs-built_in">require</span>(<span class="hljs-string">"http-proxy-middleware"</span>);
</code></pre><p>In the code above we're just importing packages. </p>
<p>Next up, initialize and set up the imported packages like this:</p>
<pre><code><span class="hljs-comment">// Create an instance of Express app</span>
<span class="hljs-keyword">const</span> app = express();


<span class="hljs-comment">// Middleware setup</span>
app.use(cors()); <span class="hljs-comment">// Enable CORS</span>
app.use(helmet()); <span class="hljs-comment">// Add security headers</span>
app.use(morgan(<span class="hljs-string">"combined"</span>)); <span class="hljs-comment">// Log HTTP requests</span>
app.disable(<span class="hljs-string">"x-powered-by"</span>); <span class="hljs-comment">// Hide Express server information</span>
</code></pre><p>Remember that an API gateway is a single source of truth for all your services or external URLs. This means you must have other services or URLs you want to forward the requests to. </p>
<p>Assuming you already have your other services running either locally or deployed, let’s move to the next section of the code.</p>
<pre><code><span class="hljs-comment">// Define routes and corresponding microservices</span>
<span class="hljs-keyword">const</span> services = [
 {
   <span class="hljs-attr">route</span>: <span class="hljs-string">"/auth"</span>,
   <span class="hljs-attr">target</span>: <span class="hljs-string">"https://your-deployed-service.herokuapp.com/auth"</span>,
 },
 {
   <span class="hljs-attr">route</span>: <span class="hljs-string">"/users"</span>,
   <span class="hljs-attr">target</span>: <span class="hljs-string">"https://your-deployed-service.herokuapp.com/users/"</span>,
 },
 {
   <span class="hljs-attr">route</span>: <span class="hljs-string">"/chats"</span>,
   <span class="hljs-attr">target</span>: <span class="hljs-string">"https://your-deployed-service.herokuapp.com/chats/"</span>,
 },
 {
   <span class="hljs-attr">route</span>: <span class="hljs-string">"/payment"</span>,
   <span class="hljs-attr">target</span>: <span class="hljs-string">"https://your-deployed-service.herokuapp.com/payment/"</span>,
 },
 <span class="hljs-comment">// Add more services as needed either deployed or locally.</span>
];
</code></pre><p>In the above code, we created a services array list and defined objects each containing routes (where we’ll make requests to) and targets (where the requests will be forwarded to).  </p>
<p>Make sure to update the routes and targets to suit your needs.</p>
<p>Can you guess what’s next…?</p>
<p>Well, it’s finally time to create the simple logic to forward the requests to our target URL, setting up a rate limit and timeouts. And do you know what’s coming next? A code sample, lol:</p>
<pre><code><span class="hljs-comment">// Define rate limit constants</span>
<span class="hljs-keyword">const</span> rateLimit = <span class="hljs-number">20</span>; <span class="hljs-comment">// Max requests per minute</span>
<span class="hljs-keyword">const</span> interval = <span class="hljs-number">60</span> * <span class="hljs-number">1000</span>; <span class="hljs-comment">// Time window in milliseconds (1 minute)</span>

<span class="hljs-comment">// Object to store request counts for each IP address</span>
<span class="hljs-keyword">const</span> requestCounts = {};

<span class="hljs-comment">// Reset request count for each IP address every 'interval' milliseconds</span>
<span class="hljs-built_in">setInterval</span>(<span class="hljs-function">() =&gt;</span> {
  <span class="hljs-built_in">Object</span>.keys(requestCounts).forEach(<span class="hljs-function">(<span class="hljs-params">ip</span>) =&gt;</span> {
    requestCounts[ip] = <span class="hljs-number">0</span>; <span class="hljs-comment">// Reset request count for each IP address</span>
  });
}, interval);

<span class="hljs-comment">// Middleware function for rate limiting and timeout handling</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">rateLimitAndTimeout</span>(<span class="hljs-params">req, res, next</span>) </span>{
  <span class="hljs-keyword">const</span> ip = req.ip; <span class="hljs-comment">// Get client IP address</span>

  <span class="hljs-comment">// Update request count for the current IP</span>
  requestCounts[ip] = (requestCounts[ip] || <span class="hljs-number">0</span>) + <span class="hljs-number">1</span>;

  <span class="hljs-comment">// Check if request count exceeds the rate limit</span>
  <span class="hljs-keyword">if</span> (requestCounts[ip] &gt; rateLimit) {
    <span class="hljs-comment">// Respond with a 429 Too Many Requests status code</span>
    <span class="hljs-keyword">return</span> res.status(<span class="hljs-number">429</span>).json({
      <span class="hljs-attr">code</span>: <span class="hljs-number">429</span>,
      <span class="hljs-attr">status</span>: <span class="hljs-string">"Error"</span>,
      <span class="hljs-attr">message</span>: <span class="hljs-string">"Rate limit exceeded."</span>,
      <span class="hljs-attr">data</span>: <span class="hljs-literal">null</span>,
    });
  }

  <span class="hljs-comment">// Set timeout for each request (example: 10 seconds)</span>
  req.setTimeout(<span class="hljs-number">15000</span>, <span class="hljs-function">() =&gt;</span> {
    <span class="hljs-comment">// Handle timeout error</span>
    res.status(<span class="hljs-number">504</span>).json({
      <span class="hljs-attr">code</span>: <span class="hljs-number">504</span>,
      <span class="hljs-attr">status</span>: <span class="hljs-string">"Error"</span>,
      <span class="hljs-attr">message</span>: <span class="hljs-string">"Gateway timeout."</span>,
      <span class="hljs-attr">data</span>: <span class="hljs-literal">null</span>,
    });
    req.abort(); <span class="hljs-comment">// Abort the request</span>
  });

  next(); <span class="hljs-comment">// Continue to the next middleware</span>
}

<span class="hljs-comment">// Apply the rate limit and timeout middleware to the proxy</span>
app.use(rateLimitAndTimeout);

<span class="hljs-comment">// Set up proxy middleware for each microservice</span>
services.forEach(<span class="hljs-function">(<span class="hljs-params">{ route, target }</span>) =&gt;</span> {
  <span class="hljs-comment">// Proxy options</span>
  <span class="hljs-keyword">const</span> proxyOptions = {
    target,
    <span class="hljs-attr">changeOrigin</span>: <span class="hljs-literal">true</span>,
    <span class="hljs-attr">pathRewrite</span>: {
      [<span class="hljs-string">`^<span class="hljs-subst">${route}</span>`</span>]: <span class="hljs-string">""</span>,
    },
  };

  <span class="hljs-comment">// Apply rate limiting and timeout middleware before proxying</span>
  app.use(route, rateLimitAndTimeout, createProxyMiddleware(proxyOptions));
});
</code></pre><p>I added a bunch of good code comments to help you understand what's going on.</p>
<p>Congratulations if you know what’s happening above. If you don’t, you can read about the <a target="_blank" href="https://www.npmjs.com/package/http-proxy-middleware">http-proxy-middleware</a> package.</p>
<p>But let’s get serious, we’re not done yet. </p>
<p>The above code still won’t work, as we need one more thing: writing a function to start the server when called upon.</p>
<p>Add the following code sample to the bottom of the index.js after all of the code you’ve added above:</p>
<pre><code><span class="hljs-comment">// Define port for Express server</span>
<span class="hljs-keyword">const</span> PORT = process.env.PORT || <span class="hljs-number">5000</span>;


<span class="hljs-comment">// Start Express server</span>
app.listen(PORT, <span class="hljs-function">() =&gt;</span> {
 <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`Gateway is running on port <span class="hljs-subst">${PORT}</span>`</span>);
});
</code></pre><p>With that, when you run <code>npm run dev</code>, it spins up your server and you should be able to test this out using tools like Postman or any other tool you use to test APIs.</p>
<p>Now, before we go, let’s try to make this a little bit spicy! </p>
<p>Let’s add a 404 function to track and return a nice 404 message to a user if they navigate or send a request to a URL that doesn’t exist. </p>
<p>So on our services array defined above, we don’t have any routes defined for <code>products</code>. This means that if a user sends a request to <code>/product</code>, they’d get a server error because the request can’t be handled. </p>
<p>To tell the user that the URL is not found, we can add the following code sample just before we define the port and listen to it:</p>
<pre><code><span class="hljs-comment">// Handler for route-not-found</span>
app.use(<span class="hljs-function">(<span class="hljs-params">_req, res</span>) =&gt;</span> {
 res.status(<span class="hljs-number">404</span>).json({
   <span class="hljs-attr">code</span>: <span class="hljs-number">404</span>,
   <span class="hljs-attr">status</span>: <span class="hljs-string">"Error"</span>,
   <span class="hljs-attr">message</span>: <span class="hljs-string">"Route not found."</span>,
   <span class="hljs-attr">data</span>: <span class="hljs-literal">null</span>,
 });
});


<span class="hljs-comment">// Define port for Express server</span>
</code></pre><h2 id="heading-conclusion">Conclusion</h2>
<p>Building a custom API gateway with Node.js offers developers a flexible and customizable solution for managing, routing, and securing API calls in a microservices architecture. </p>
<p>Throughout this tutorial, we've explored the fundamental concepts of API gateways, including their role in simplifying client-side code, improving scalability and performance, and enhancing security.</p>
<p>By leveraging the power of Node.js and the <code>http-proxy-middleware</code> package, we've demonstrated how to implement a basic API gateway that proxies requests to multiple backend services. We've also enhanced our gateway with essential features such as rate limiting and timeouts to ensure reliable and secure communication between clients and services.</p>
<p>As you continue to explore the world of microservices and distributed systems, remember that API gateways play a crucial role in orchestrating communication and enforcing security measures. Whether you choose to build a custom solution or utilize existing gateway platforms, understanding the principles and best practices outlined in this tutorial will empower you to architect robust and scalable systems.</p>
<p>I encourage you to experiment with the code samples provided and explore further customization options to suit your project's unique requirements. The complete source code for this tutorial can be found here: https://github.com/irorochad/api-gateway.</p>
<p>Thank you for joining me on this journey to explore the intricacies of API gateways with Node.js. Happy coding!</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
