<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: John Otienoh </title>
    <description>The latest articles on DEV Community by John Otienoh  (@john_otienoh).</description>
    <link>https://dev.to/john_otienoh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1246073%2F19376601-27b0-4298-acef-43a2b16411ef.jpg</url>
      <title>DEV Community: John Otienoh </title>
      <link>https://dev.to/john_otienoh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/john_otienoh"/>
    <language>en</language>
    <item>
      <title>Data Engineering Described</title>
      <dc:creator>John Otienoh </dc:creator>
      <pubDate>Sat, 13 Jun 2026 08:48:36 +0000</pubDate>
      <link>https://dev.to/john_otienoh/data-engineering-described-50kf</link>
      <guid>https://dev.to/john_otienoh/data-engineering-described-50kf</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt; &lt;em&gt;Fundamentals of Data Engineering&lt;/em&gt; by Joe Reis and Matt Housley, published by O'Reilly Media.&lt;/p&gt;

&lt;p&gt;This article summarizes and interprets key concepts from &lt;strong&gt;Chapter 1: Data Engineering Described&lt;/strong&gt;. It is not a reproduction of the original text but a study guide and learning resource based on the chapter.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Data engineering has become one of the most critical disciplines in modern technology organizations. Every dashboard, machine learning model, business report, and analytical insight depends on reliable data pipelines built and maintained by data engineers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Data Engineering?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Data engineering is the development, implementation, and maintenance of systems and processes that take in raw data and produce high-quality, consistent information that supports downstream use cases, such as analysis and machine learning. A data engineer manages the data engineering lifecycle, beginning with getting data from source systems and ending with serving data for use cases, such as analysis or machine learning.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Data engineering sits at the intersection of several disciplines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Architecture&lt;/li&gt;
&lt;li&gt;Data Management&lt;/li&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;DataOps&lt;/li&gt;
&lt;li&gt;Orchestration&lt;/li&gt;
&lt;li&gt;Software Engineering&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A data engineer's responsibility extends from collecting data from source systems to making that data available for analytics, reporting, and machine learning applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Data Engineering Lifecycle
&lt;/h2&gt;

&lt;p&gt;Data engineering is a lifecycle rather than a collection of isolated tools.&lt;/p&gt;

&lt;p&gt;The lifecycle consists of five major stages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Generation → Storage → Ingestion → Transformation → Serving
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Undercurrents of Data Engineering
&lt;/h2&gt;

&lt;p&gt;While the lifecycle represents the flow of data, several concepts influence every stage i.e &lt;strong&gt;undercurrents&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Data Management&lt;/li&gt;
&lt;li&gt;DataOps&lt;/li&gt;
&lt;li&gt;Data Architecture&lt;/li&gt;
&lt;li&gt;Orchestration&lt;/li&gt;
&lt;li&gt;Software Engineering&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These disciplines are not separate activities; they support and shape the entire lifecycle.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security protects data assets.&lt;/li&gt;
&lt;li&gt;DataOps improves operational efficiency.&lt;/li&gt;
&lt;li&gt;Architecture ensures scalability.&lt;/li&gt;
&lt;li&gt;Software engineering principles improve reliability and maintainability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Evolution of the Data Engineer
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Data Warehousing Era (1980s–2000s)
&lt;/h3&gt;

&lt;p&gt;The first major era of data engineering emerged with data warehousing.&lt;/p&gt;

&lt;p&gt;Organizations began building centralized repositories for analytics using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enterprise Data Warehouses&lt;/li&gt;
&lt;li&gt;Massively Parallel Processing (MPP) systems&lt;/li&gt;
&lt;li&gt;Business Intelligence platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This period introduced large-scale analytical processing capabilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Big Data Era (2000s–2010s)
&lt;/h3&gt;

&lt;p&gt;As data volumes exploded, traditional systems struggled to scale.&lt;/p&gt;

&lt;p&gt;New technologies emerged:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hadoop&lt;/li&gt;
&lt;li&gt;Spark&lt;/li&gt;
&lt;li&gt;Distributed storage systems&lt;/li&gt;
&lt;li&gt;Cloud-based data platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The role evolved into the "Big Data Engineer," focused on processing massive datasets efficiently.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Modern Data Engineering Era
&lt;/h3&gt;

&lt;p&gt;Today's data engineers work across:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloud platforms&lt;/li&gt;
&lt;li&gt;Data lakes&lt;/li&gt;
&lt;li&gt;Streaming systems&lt;/li&gt;
&lt;li&gt;Machine learning infrastructure&lt;/li&gt;
&lt;li&gt;Real-time analytics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The profession now emphasizes business value as much as technical implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Engineering vs. Data Science
&lt;/h2&gt;

&lt;p&gt;One of the most important distinctions made in Chapter 1 is that data engineering and data science are separate disciplines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Engineers
&lt;/h3&gt;

&lt;p&gt;Focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Building pipelines&lt;/li&gt;
&lt;li&gt;Managing infrastructure&lt;/li&gt;
&lt;li&gt;Ensuring data quality&lt;/li&gt;
&lt;li&gt;Scaling systems&lt;/li&gt;
&lt;li&gt;Delivering reliable datasets&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Data Scientists
&lt;/h3&gt;

&lt;p&gt;Focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Analysis&lt;/li&gt;
&lt;li&gt;Experimentation&lt;/li&gt;
&lt;li&gt;Statistical modeling&lt;/li&gt;
&lt;li&gt;Machine learning&lt;/li&gt;
&lt;li&gt;Business insights&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In simple terms:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Data Engineers → Build the foundation

Data Scientists → Create value from that foundation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Data engineering sits upstream, providing the inputs necessary for data science and analytics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Data Maturity
&lt;/h2&gt;

&lt;p&gt;Data maturity reflects how effectively an organization leverages data as a strategic asset.&lt;/p&gt;

&lt;p&gt;Importantly, maturity is not determined by company age or size.&lt;/p&gt;

&lt;p&gt;A startup can be more data mature than a century-old enterprise if it uses data more effectively.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Primary Focus&lt;/th&gt;
&lt;th&gt;Key Activities&lt;/th&gt;
&lt;th&gt;Best Practices&lt;/th&gt;
&lt;th&gt;Risks / Pitfalls&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;1. Starting with Data&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Establish a data foundation aligned with business goals&lt;/td&gt;
&lt;td&gt;- Define data architecture&lt;br&gt;- Identify and audit relevant data sources&lt;br&gt;- Build foundational data systems&lt;br&gt;- Enable future analytics and ML use cases&lt;/td&gt;
&lt;td&gt;- Secure executive sponsorship&lt;br&gt;- Deliver quick wins to demonstrate value&lt;br&gt;- Engage business stakeholders frequently&lt;br&gt;- Use off-the-shelf solutions where possible&lt;br&gt;- Build custom solutions only for competitive advantage&lt;/td&gt;
&lt;td&gt;- Lack of visible business impact reduces support&lt;br&gt;- Technical debt from rapid delivery&lt;br&gt;- Working in silos without stakeholder feedback&lt;br&gt;- Overengineering and unnecessary complexity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;2. Scaling with Data&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Create scalable, repeatable, and operational data practices&lt;/td&gt;
&lt;td&gt;- Formalize data engineering processes&lt;br&gt;- Build scalable architectures&lt;br&gt;- Implement DevOps and DataOps practices&lt;br&gt;- Develop ML-ready infrastructure&lt;/td&gt;
&lt;td&gt;- Prioritize simplicity and maintainability&lt;br&gt;- Focus on team productivity and scalability&lt;br&gt;- Select technologies based on business value&lt;br&gt;- Educate the organization on data usage&lt;/td&gt;
&lt;td&gt;- Chasing trendy technologies without ROI&lt;br&gt;- Overcomplicating infrastructure&lt;br&gt;- Treating technology as the bottleneck instead of team capacity&lt;br&gt;- Focusing on technical prestige instead of business outcomes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;3. Leading with Data&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Use data as a strategic competitive advantage across the organization&lt;/td&gt;
&lt;td&gt;- Automate data onboarding and usage&lt;br&gt;- Build proprietary data products&lt;br&gt;- Implement governance, quality, and metadata management&lt;br&gt;- Deploy data catalogs and lineage tools&lt;br&gt;- Foster cross-functional collaboration&lt;/td&gt;
&lt;td&gt;- Invest in DataOps and governance&lt;br&gt;- Promote transparency and collaboration&lt;br&gt;- Share data broadly across teams&lt;br&gt;- Build custom systems only when they create measurable advantage&lt;/td&gt;
&lt;td&gt;- Organizational complacency&lt;br&gt;- Neglecting maintenance and continuous improvement&lt;br&gt;- Pursuing expensive technology projects with little business value&lt;br&gt;- Overengineering custom solutions without strategic benefit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The Background and Skills of a Data Engineer
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Business Responsibilities of a Data Engineer
&lt;/h3&gt;

&lt;p&gt;Technical ability alone is not sufficient.&lt;br&gt;
Here are several critical business responsibilities.&lt;/p&gt;

&lt;h4&gt;
  
  
  Communication
&lt;/h4&gt;

&lt;p&gt;Data engineers must communicate effectively with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Executives&lt;/li&gt;
&lt;li&gt;Product managers&lt;/li&gt;
&lt;li&gt;Analysts&lt;/li&gt;
&lt;li&gt;Data scientists&lt;/li&gt;
&lt;li&gt;Software engineers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Trust and collaboration are essential.&lt;/p&gt;

&lt;h4&gt;
  
  
  Requirements Gathering
&lt;/h4&gt;

&lt;p&gt;Engineers must understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What stakeholders need&lt;/li&gt;
&lt;li&gt;Why they need it&lt;/li&gt;
&lt;li&gt;How data solutions support business goals&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Understanding Agile, DevOps, and DataOps
&lt;/h4&gt;

&lt;p&gt;These are cultural practices as much as technical methodologies.&lt;/p&gt;

&lt;p&gt;Successful implementation requires organizational alignment, not just tooling.&lt;/p&gt;

&lt;h4&gt;
  
  
  Cost Management
&lt;/h4&gt;

&lt;p&gt;Data engineers should optimize:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Time-to-value&lt;/li&gt;
&lt;li&gt;Total cost of ownership&lt;/li&gt;
&lt;li&gt;Opportunity cost&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Monitoring cloud and infrastructure spending is a core responsibility.&lt;/p&gt;

&lt;h4&gt;
  
  
  Continuous Learning
&lt;/h4&gt;

&lt;p&gt;The data ecosystem evolves rapidly.&lt;/p&gt;

&lt;p&gt;Strong data engineers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn continuously&lt;/li&gt;
&lt;li&gt;Evaluate new technologies critically&lt;/li&gt;
&lt;li&gt;Distinguish innovations from hype&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Technical Responsibilities of a Data Engineer
&lt;/h3&gt;

&lt;h4&gt;
  
  
  SQL
&lt;/h4&gt;

&lt;p&gt;SQL remains the most important language in data engineering.&lt;/p&gt;

&lt;p&gt;It is used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Querying data&lt;/li&gt;
&lt;li&gt;Transformations&lt;/li&gt;
&lt;li&gt;Analytics&lt;/li&gt;
&lt;li&gt;Data warehousing&lt;/li&gt;
&lt;li&gt;Data lake-house operations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Despite the rise of big data technologies, SQL continues to be the dominant language of data.&lt;/p&gt;

&lt;h4&gt;
  
  
  Python
&lt;/h4&gt;

&lt;p&gt;Python serves as a bridge between data engineering and data science.&lt;/p&gt;

&lt;p&gt;Popular tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pandas&lt;/li&gt;
&lt;li&gt;NumPy&lt;/li&gt;
&lt;li&gt;Airflow&lt;/li&gt;
&lt;li&gt;PySpark&lt;/li&gt;
&lt;li&gt;TensorFlow&lt;/li&gt;
&lt;li&gt;PyTorch&lt;/li&gt;
&lt;li&gt;Scikit-learn&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Python excels at automation, orchestration, and integration.&lt;/p&gt;

&lt;h4&gt;
  
  
  Java and Scala
&lt;/h4&gt;

&lt;p&gt;These languages are commonly used in large-scale distributed systems such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Apache Spark&lt;/li&gt;
&lt;li&gt;Apache Hive&lt;/li&gt;
&lt;li&gt;Apache Druid&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They often provide greater performance and lower-level access than Python APIs.&lt;/p&gt;

&lt;h4&gt;
  
  
  Bash
&lt;/h4&gt;

&lt;p&gt;Command-line skills remain valuable for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automation&lt;/li&gt;
&lt;li&gt;File processing&lt;/li&gt;
&lt;li&gt;System administration&lt;/li&gt;
&lt;li&gt;Data pipeline operations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tools like &lt;code&gt;awk&lt;/code&gt;, &lt;code&gt;sed&lt;/code&gt;, and shell scripting continue to play an important role in production environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;p&gt;Chapter 1 establishes several foundational ideas:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data engineering transforms raw data into usable information.&lt;/li&gt;
&lt;li&gt;The data engineering lifecycle includes generation, storage, ingestion, transformation, and serving.&lt;/li&gt;
&lt;li&gt;Security, architecture, DataOps, and software engineering influence every stage of the lifecycle.&lt;/li&gt;
&lt;li&gt;Data engineering and data science are complementary but distinct disciplines.&lt;/li&gt;
&lt;li&gt;Data maturity reflects how effectively organizations use data as a strategic asset.&lt;/li&gt;
&lt;li&gt;Successful data engineers combine technical expertise with business understanding.&lt;/li&gt;
&lt;li&gt;SQL, Python, JVM languages, and Bash remain foundational technical skills.&lt;/li&gt;
&lt;li&gt;The ultimate goal of data engineering is delivering business value through reliable and scalable data systems.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Reference
&lt;/h2&gt;

&lt;p&gt;Reis, J., &amp;amp; Housley, M. (2022). &lt;em&gt;Fundamentals of Data Engineering: Plan and Build Robust Data Systems&lt;/em&gt;. O'Reilly Media. Chapter 1: &lt;em&gt;Data Engineering Described&lt;/em&gt;.&lt;/p&gt;

</description>
      <category>dataengineering</category>
      <category>data</category>
      <category>intoductiontodataengineering</category>
    </item>
    <item>
      <title>Me-API</title>
      <dc:creator>John Otienoh </dc:creator>
      <pubDate>Fri, 17 Oct 2025 13:04:10 +0000</pubDate>
      <link>https://dev.to/john_otienoh/me-api-13mk</link>
      <guid>https://dev.to/john_otienoh/me-api-13mk</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Simple RESTful API endpoint that returns your profile information along with a dynamic cat fact fetched from an external API.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;As part of the HNG Internship Backend track Stage 0 Task, I was challenged to build a simple yet dynamic RESTful API that returns my profile details along with a live cat fact fetched from the Cat Facts API.&lt;br&gt;
This task has helped me sharpen key backend development concepts — from API integration, response structuring, time formatting, to error handling and deployment.&lt;/p&gt;
&lt;h2&gt;
  
  
  Task Requirements
&lt;/h2&gt;

&lt;p&gt;The goal was to create a &lt;code&gt;GET /me&lt;/code&gt; endpoint that returns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"johndoe@gmail.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"John Doe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"stack"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Python/FastAPI"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2025-10-17T12:34:56.789Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fact"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Cats sleep for 70% of their lives."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cat fact must come dynamically from the &lt;a href="https://catfact.ninja/fact" rel="noopener noreferrer"&gt;public API&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools &amp;amp; Technologies
&lt;/h2&gt;

&lt;p&gt;Framework: FastAPI&lt;br&gt;
Language: Python 3&lt;br&gt;
Deployment Platform: Railway&lt;/p&gt;
&lt;h2&gt;
  
  
  My Implementation Process
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;- Project Setup&lt;/strong&gt;&lt;br&gt;
I created a new FastAPI project and installed dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install fastapi uvicorn requests python-dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;- Defined Schema with Pydantic.&lt;/strong&gt;&lt;br&gt;
To maintain clean and validated responses, I created a schema.py:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pydantic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EmailStr&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Model for the response&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;EmailStr&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Profile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt;
    &lt;span class="n"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;
    &lt;span class="n"&gt;fact&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;- Get cat facts&lt;/strong&gt;&lt;br&gt;
To get the cat facts from the &lt;a href="https://catfact.ninja/fact" rel="noopener noreferrer"&gt;Cat Fact API&lt;/a&gt;, i created the catfact.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;cat_fact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;raise_for_status&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;response_dict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;fact&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response_dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fact&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;fact&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Could not fetch cat fact at this time.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fact&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;-  Built the &lt;code&gt;/me&lt;/code&gt; Endpoint&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timezone&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi.middleware.cors&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;CORSMiddleware&lt;/span&gt; 

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;app.schema&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Profile&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;app.catfact&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cat_fact&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://catfact.ninja/fact&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="n"&gt;origins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;CORSMiddleware&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;allow_origins&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;origins&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;allow_credentials&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;allow_methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;allow_headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;



&lt;span class="n"&gt;my_info&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Success&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;email&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;johnteclaire@gmail.com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;John Charles Otienoh&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;stack&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Python/fastAPI&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;timestamp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timezone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utc&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;isoformat&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fact&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/me&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response_model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Profile&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_my_info&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Retreive Basic information&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;my_info&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;fact&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;cat_fact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;my_info&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;- Tested the API&lt;/strong&gt;&lt;br&gt;
I used cURL to test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl http://localhost:8000/me
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The API returned a live cat fact and a real-time timestamp every request!&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;How to consume external APIs safely using requests&lt;/li&gt;
&lt;li&gt;How to handle timeouts, errors, and fallbacks&lt;/li&gt;
&lt;li&gt;How to return structured JSON with Pydantic models&lt;/li&gt;
&lt;li&gt;The importance of clean documentation and response validation&lt;/li&gt;
&lt;li&gt;How to think about API reliability and best practices (timeouts, CORS, content-type headers, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Repo: &lt;a href="https://github.com/john-otienoh/Me_API" rel="noopener noreferrer"&gt;https://github.com/john-otienoh/Me_API&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Live API: &lt;a href="https://meapi-production.up.railway.app/me" rel="noopener noreferrer"&gt;https://meapi-production.up.railway.app/me&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Contact: &lt;a href="mailto:johnteclaire@gmail.com"&gt;johnteclaire@gmail.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>fastapi</category>
      <category>backend</category>
      <category>api</category>
      <category>python</category>
    </item>
    <item>
      <title>Recursion</title>
      <dc:creator>John Otienoh </dc:creator>
      <pubDate>Fri, 17 Oct 2025 12:37:13 +0000</pubDate>
      <link>https://dev.to/john_otienoh/recursion-61l</link>
      <guid>https://dev.to/john_otienoh/recursion-61l</guid>
      <description>&lt;p&gt;What is Recursion?&lt;br&gt;
Any function which calls itself is called recursive. A recursive method solves a problem by calling a copy of itself to work on a smaller problem. This is called the recursion step.The recursion step can result in many more such recursive calls.&lt;br&gt;
It is useful in sort, search, and traversal problems that often have simple recursive solutions.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax
&lt;/h4&gt;

</description>
      <category>datastructures</category>
      <category>recursion</category>
      <category>algorithms</category>
      <category>programming</category>
    </item>
    <item>
      <title>A beginner's guide to data engineering concepts, tools, and responsibilities.</title>
      <dc:creator>John Otienoh </dc:creator>
      <pubDate>Mon, 05 Aug 2024 11:34:31 +0000</pubDate>
      <link>https://dev.to/john_otienoh/a-beginners-guide-to-data-engineering-concepts-tools-and-responsibilities-3pd</link>
      <guid>https://dev.to/john_otienoh/a-beginners-guide-to-data-engineering-concepts-tools-and-responsibilities-3pd</guid>
      <description>&lt;h2&gt;
  
  
  Data Engineering Concepts
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbiuh1bhd7vsto7mdclc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbiuh1bhd7vsto7mdclc.png" alt="Image description" width="720" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Data engineering is the process of designing, building, and maintaining the infrastructure for storing, processing, and retrieving large datasets. It involves creating systems that efficiently collect, transform, and store data, making it usable for analysis and decision-making.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools for data engineers.
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;Scripting and programming language:&lt;/em&gt; python is the commonly used language in data engineering due to its simplicity and extensive libraries , which is used in transformation and data cleaning. There are other languages that are used such as ruby, Scala among others.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Databases&lt;/em&gt;: data engineers use various databases like MySQL to store and manage structured data for analytics and reporting.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data visualization tools:&lt;/em&gt; to gain insights and patterns from data, a data engineer should be familiar with various tools used in visualization such as tableau and Power BI.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data warehousing and storage tools:&lt;/em&gt; the commonly used tool in managing data is snowflake, snowflake is a cloud data warehouse that allow one to store and manage data, snowflake is very flexible since it works with some programming languages such as python&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Responsibilities:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Designing data pipelines to collect and process data from various sources&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Developing data warehouses and lakes to store structured and unstructured data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ensuring data quality, integrity, and security.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Building scalable and high-performance data processing systems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Collaborating with data scientists and analysts to understand their data needs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Implementing data governance policies and metadata management.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>dataengineering</category>
      <category>data</category>
      <category>datascience</category>
    </item>
    <item>
      <title>POST-MORTEM</title>
      <dc:creator>John Otienoh </dc:creator>
      <pubDate>Fri, 28 Jun 2024 20:05:58 +0000</pubDate>
      <link>https://dev.to/john_otienoh/post-mortem-3838</link>
      <guid>https://dev.to/john_otienoh/post-mortem-3838</guid>
      <description>&lt;h1&gt;
  
  
  Database Connection
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExeXNlenIwa291dTBtd3p4ZTZpaDEzbXdxMnd6NmkzdXF3dnJwM2RoMiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F6boXVnFugfXzY3wWPU%2Fgiphy.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExeXNlenIwa291dTBtd3p4ZTZpaDEzbXdxMnd6NmkzdXF3dnJwM2RoMiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F6boXVnFugfXzY3wWPU%2Fgiphy.webp" alt="worried"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Issue Summary
&lt;/h2&gt;

&lt;p&gt;Duration: 2 hours 55 minutes (14:55 UTC - 17:50 UTC).&lt;br&gt;
The affected service was the website's search functionality leading to  20% of users experienced slow load times, with average page load times increasing by 7 seconds.&lt;br&gt;
The root Cause was a misconfigured database connection pooling leading to connection timeouts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Timeline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;14:55 UTC: Monitoring alerts triggered for high response times on the search functionality.&lt;/li&gt;
&lt;li&gt;15:00 UTC: Engineer on call investigates and notices high CPU usage on the database server.&lt;/li&gt;
&lt;li&gt;15:10 UTC: Initial assumption is that the issue is related to a recent code deployment, and the team begins reviewing code changes.&lt;/li&gt;
&lt;li&gt;15:20 UTC: Investigation reveals no issues with the code deployment, and attention turns to the database server.&lt;/li&gt;
&lt;li&gt;15:40 UTC: Misleading investigation path: The team explores the possibility of a database query optimization issue.&lt;/li&gt;
&lt;li&gt;16:00 UTC: Escalation to the database administration team.&lt;/li&gt;
&lt;li&gt;16:20 UTC: Root cause identified: misconfigured database connection pooling.&lt;/li&gt;
&lt;li&gt;16:55 UTC: Configuration changes made to the database connection pooling.&lt;/li&gt;
&lt;li&gt;17:50 UTC: Issue resolved, page load times return to normal.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fjohn-otienoh%2Falx-system_engineering-devops%2Fassets%2F125456275%2F3f92baad-5abc-40d0-a118-13c2bb3485c7" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fjohn-otienoh%2Falx-system_engineering-devops%2Fassets%2F125456275%2F3f92baad-5abc-40d0-a118-13c2bb3485c7" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Root Cause and Resolution
&lt;/h2&gt;

&lt;p&gt;The root cause of the issue was a misconfigured database connection pooling setting, which led to connection timeouts and increased CPU usage on the database server. This caused slow load times for 20% of users, affecting the website's search functionality.&lt;br&gt;
The issue was resolved by adjusting the database connection pooling settings to optimize connection reuse and reduce timeouts. This change was made in collaboration with the database administration team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Corrective and Preventative Measures
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Improve database connection pooling configuration and monitoring.&lt;/li&gt;
&lt;li&gt;Implement automated testing for database connection pooling settings.&lt;/li&gt;
&lt;li&gt;Enhance monitoring for CPU usage on the database server.&lt;/li&gt;
&lt;li&gt;Conduct regular reviews of database server performance and configuration.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fjohn-otienoh%2Falx-system_engineering-devops%2Fassets%2F125456275%2Fae541613-59b1-4f5d-a49d-4fcace75e5b2" alt="image"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  TODO List
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Patch database connection pooling configuration to optimize connection reuse.&lt;/li&gt;
&lt;li&gt;Add monitoring for database connection timeouts.&lt;/li&gt;
&lt;li&gt;Implement automated testing for database connection pooling settings.&lt;/li&gt;
&lt;li&gt;Schedule regular database server performance reviews.&lt;/li&gt;
&lt;li&gt;Develop a playbook for troubleshooting database connection issues.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This postmortem highlights the importance of thorough investigation and collaboration between teams to resolve complex issues. By identifying and addressing the root cause of the problem, we can prevent similar issues from occurring in the future and improve the overall reliability of our services.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>0x00. Shell, navigation</title>
      <dc:creator>John Otienoh </dc:creator>
      <pubDate>Sat, 08 Jun 2024 22:42:29 +0000</pubDate>
      <link>https://dev.to/john_otienoh/0x00-shell-navigation-3jpb</link>
      <guid>https://dev.to/john_otienoh/0x00-shell-navigation-3jpb</guid>
      <description>&lt;h2&gt;
  
  
  File System Organization
&lt;/h2&gt;

&lt;p&gt;Like Windows, the files on a Linux system are arranged in what is called a hierarchical directory structure. This means that they are organized in a tree-like pattern of directories (called folders in other systems), which may contain files and subdirectories. The first directory in the file system is called the root directory. The root directory contains files and subdirectories, which contain more files and subdirectories and so on and so on.&lt;br&gt;
The basic three commands include: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;pwd&lt;/strong&gt; (print working directory)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;cd&lt;/strong&gt; (change directory)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ls&lt;/strong&gt; (list files and directories).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  pwd
&lt;/h3&gt;

&lt;p&gt;The directory we are standing in is called the working directory. To see the name of the working directory, we use the pwd command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[me@linuxbox me]$ pwd
/home/me
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we first log on to our Linux system, the working directory is set to our home directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  cd
&lt;/h3&gt;

&lt;p&gt;To change the working directory (where we are standing in the maze) we use the cd command. To do this, we type cd followed by the pathname of the desired working directory. A pathname is the route we take along the branches of the tree to get to the directory we want.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;me@linuxbox me]$ cd /usr/bin
me@linuxbox bin]$ pwd
/usr/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we type &lt;code&gt;cd&lt;/code&gt; followed by nothing, cd will change the working directory to our home directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;me@linuxbox me]$ cd
me@linuxbox bin]$ pwd
/home/me
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A related shortcut is to type &lt;code&gt;cd ~user_name&lt;/code&gt;. In this case, cd will change the working directory to the home directory of the specified user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;me@linuxbox me]$ cd ~me
me@linuxbox bin]$ pwd
/home/me
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Typing &lt;code&gt;cd -&lt;/code&gt; or &lt;code&gt;cd ..&lt;/code&gt; changes the working directory to the previous one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;me@linuxbox me]$ cd /usr/bin
me@linuxbox bin]$ pwd
/usr/bin
me@linuxbox me]$ cd ..
me@linuxbox bin]$ pwd
/usr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ls
&lt;/h3&gt;

&lt;p&gt;It is used to list the files in the current working directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[me@linuxbox me]$ ls
Desktop   Download  Pictures  Music  Templates  Documents examples.desktop    Public  Videos
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;File names that begin with a period character are hidden. This only means that ls will not list them unless we say &lt;code&gt;ls -a&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[me@linuxbox me]$ ls -la
.git/    .ssh/   .ipython/ Desktop   Download  Pictures  Music  Templates
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ls -l&lt;/code&gt;List the files in the working directory in long format&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[me@linuxbox me]$ ls -l
drwxr-xr-x 1 me 197121  0 Oct 17  2023  OneDrive/
drwxr-xr-x 1 me 197121  0 Jan 17  2023  Pictures/
drwxr-xr-x 1 me 197121  0 Mar  3  2023  Saved Games/
drwxr-xr-x 1 me 197121  0 Apr 27  2023  Searches/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Displaying file contents
&lt;/h3&gt;

&lt;p&gt;There are several commands to display the content of a file in Linux.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;cat&lt;/code&gt; command
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cat filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;head&lt;/code&gt; and &lt;code&gt;tail&lt;/code&gt; commands&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;head&lt;/code&gt; command displays the first 10 lines of a file, while the &lt;code&gt;tail&lt;/code&gt; command displays the last 10 lines of a file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ head filename   # displays the first 10 lines of a file
$ tail filename   # displays the last 10 lines of a file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can modify the number of lines displayed by using the &lt;code&gt;-n&lt;/code&gt; option, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ head -n 5 filename   # displays the first 5 lines of a file
$ tail -n 5 filename   # displays the last 5 lines of a file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;less&lt;/code&gt; command&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;less&lt;/code&gt; command allows you to view a file one page at a time. It allows you navigate through the file using the arrow keys or page up/down keys.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ less filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;awk&lt;/code&gt; command&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This command uses &lt;code&gt;awk&lt;/code&gt; to print each line of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ awk '1' filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating files and directories
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Create a file:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using the &lt;code&gt;touch&lt;/code&gt; command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ touch filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a new empty file with the specified name.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using a text editor:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ nano filename # using the nano editor.
$ vi filename # using vim editor.
$ code filename # using vscode editor.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will open a text editor where you can create and edit the file. Once you're done, save and exit the editor.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using the &lt;code&gt;echo&lt;/code&gt; command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ echo "Hello World!" &amp;gt; filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a new file with the specified name and add the text "Hello World!" to it.&lt;br&gt;
&lt;strong&gt;Create a directory:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using the &lt;code&gt;mkdir&lt;/code&gt; command:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mkdir directoryname
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will create a new directory with the specified name.&lt;/p&gt;
&lt;h3&gt;
  
  
  Removing a file or directory
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Removing a file:&lt;/strong&gt;&lt;br&gt;
To remove a file, use the &lt;code&gt;rm&lt;/code&gt; command followed by the name of the file you want to remove:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rm filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the file is write-protected, &lt;code&gt;rm&lt;/code&gt; will ask you to confirm the deletion. To remove the file without prompting, use the &lt;code&gt;-f&lt;/code&gt; option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rm -f filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Removing a directory:&lt;/strong&gt;&lt;br&gt;
To remove an empty directory, use the &lt;code&gt;rmdir&lt;/code&gt; command followed by the name of the directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rmdir directoryname
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the directory is not empty, you will get an error message. To remove a non-empty directory and all its contents, use the &lt;code&gt;rm&lt;/code&gt; command with the &lt;code&gt;-r&lt;/code&gt; option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rm -r directoryname
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Moving or Copying a file or directory
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Moving a file or directory:&lt;/strong&gt;&lt;br&gt;
To move a file or directory, use the &lt;code&gt;mv&lt;/code&gt; command followed by the source file or directory and the destination:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mv source destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Renaming a file or directory:&lt;/strong&gt;&lt;br&gt;
To rename a file or directory, use the &lt;code&gt;mv&lt;/code&gt; command with the source file or directory and the new name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mv oldname newname
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Copying a file or directory:&lt;/strong&gt;&lt;br&gt;
To copy a file or directory, use the cp command followed by the source file or directory and the destination:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cp source destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To copy a directory and all its contents, use the &lt;code&gt;-r&lt;/code&gt; option with the cp command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cp -r source destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will copy the entire directory source and all its contents to destination.&lt;br&gt;
&lt;strong&gt;Using &lt;code&gt;rsync&lt;/code&gt; command:&lt;/strong&gt;&lt;br&gt;
The &lt;code&gt;rsync&lt;/code&gt; command is a powerful tool for copying and synchronizing files and directories. It can be used to copy files and directories while preserving permissions, timestamps, and other attributes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rsync -avz sourceDir destinationDir
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will copy the entire directory sourceDir and all its contents to the specified destination, preserving permissions, timestamps, and other attributes.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks for your time! Please leave a comment and any suggestions are welcome. Follow me to get updates.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>shell</category>
      <category>bash</category>
      <category>softwareengineering</category>
      <category>alxsoftwareengineering</category>
    </item>
  </channel>
</rss>
