保留正文与补采附件。源页面当前未重新核验;具体限制见交付清单。

Revisit consent button We value your privacy We use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking "Accept All", you consent to our use of cookies. Customise Reject All Accept All Customise Consent Preferences We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below. The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more NecessaryAlways Active Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

Functional Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

Analytics Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Performance Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Advertisement Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

Uncategorised Other uncategorised cookies are those that are being analysed and have not been classified into a category as yet. No cookies to display. Reject All Save My Preferences Accept All Toggle SearchToggle Mobile Navigation Publish AI, ML & data-science insights to a global community of data professionals. Sign inSubmit an Article LatestEditor's PicksNewsletterShipAI


Write For TDS LinkedInXToggle Search Data Engineering

I Built My Second ETL Pipeline. This Time, I Started Thinking Like a Data Engineer

Building a production-ready RSS pipeline with Python, Docker, PostgreSQL, and Kestra Ibrahim Salami July 10, 202615 min read Architectural Diagram Generated by AI A few months ago, I decided I wanted to transition from data analyst to data engineer. Like many people starting out, I was overwhelmed by the sheer number of things I thought I needed to learn. Data warehouses, orchestration tools, distributed processing, streaming systems, cloud platforms, infrastructure. The list seemed endless. Instead of trying to learn everything at once, I took a different approach. I created a 12-month self-study roadmap built around one simple idea: learn by building. Rather than jumping from one tutorial to another, I would build a series of small projects. Each project would introduce a few new concepts while reinforcing what I had learned before. The goal wasn't to build the most sophisticated applications possible. It was to develop the habit of thinking like an engineer by solving one problem at a time. The first project in that journey was a GitHub ETL pipeline. It began as a simple Python script that fetched repository data and exported it to a CSV file. As I learned more, I gradually improved it. I replaced CSV files with SQLite, made the pipeline idempotent to prevent duplicate data, and eventually automated it with GitHub Actions. By the time I finished, I realized something that hadn't been obvious when I started. Building the ETL logic was actually the easy part. The harder questions appeared once I stopped thinking about a script that runs once and started thinking about a system that needs to run over and over again without me watching it.

Those questions taught me far more about data engineering than parsing JSON or writing SQL ever did. That first project left me with another challenge. GitHub Actions worked well for automating a small ETL pipeline, but I wanted to understand what changes when you use a workflow orchestrator built specifically for data engineering. I wanted to learn how engineers separate orchestration from execution, how containerized workloads fit into that picture, and what a production-minded pipeline actually looks like, even on a small scale. So for my second project, I decided to build an automated RSS ingestion pipeline. On the surface, it's a fairly simple application. It fetches articles from an RSS feed, parses them into structured objects, and stores them in PostgreSQL. But the goal was never to build an RSS reader. The goal was to explore the engineering decisions that transform a Python script into a reliable data pipeline. In this article, I'll walk through those decisions, the mistakes I made along the way, and the lessons I learned building my first pipeline with Kestra.

Why Build Another ETL Pipeline?

After finishing my first ETL project, I considered moving on to something completely different. Maybe a data warehouse project. Maybe Apache Spark. Maybe an API with a more complex transformation layer. Instead, I built... another ETL pipeline. At first, that probably sounds like a step backwards. After all, I'd already built an extraction pipeline, made it idempotent, and scheduled it with GitHub Actions. Why repeat the same exercise? Because I wasn't trying to learn a new dataset. I was trying to learn a new way of thinking. One lesson from my first project stuck with me. Writing the ETL logic wasn't the difficult part. The difficult part was everything surrounding it.

And perhaps the biggest question of all:

Where should the responsibilities of the application end, and where should the responsibilities of the orchestration layer begin? Those questions don't have much to do with RSS feeds or GitHub repositories. They're engineering questions, and I realized I could explore them with almost any data source. That's why I chose an RSS feed. Not because RSS is particularly exciting, but because it's intentionally simple. The extraction logic only takes a few lines of Python. That meant I could spend less time worrying about business logic and more time thinking about architecture. For the same reason, I decided to move away from GitHub Actions for this project. GitHub Actions was a great introduction to scheduling. It showed me how to automate a workflow and gave me my first taste of running an ETL pipeline without manual intervention. But GitHub Actions isn't designed specifically for orchestrating data workflows. I wanted to understand what changes when you use a tool that's built with data pipelines in mind. That's what led me to Kestra. Rather than asking, "How do I run this Python script every hour?", I found myself asking a different set of questions.

Those questions were exactly what I wanted to explore. By choosing a simple ETL pipeline, I could focus on the engineering decisions instead of getting distracted by complicated business logic. Looking back, I think that was the right decision. This project isn't interesting because it processes RSS feeds. It's interesting because building it forced me to think about reliability, repeatability, and orchestration in a way my first project never did.

The First Architectural Decision: Docker Before Kestra

With the project defined, my first instinct was to jump straight into Kestra. After all, orchestration was one of the main reasons I chose this project. Why not start there? Instead, I did something that turned out to save me a lot of frustration later. I ignored Kestra completely. That might sound counterintuitive, but I wanted to avoid introducing multiple moving parts before I knew the core application actually worked. So I built the project in layers. First, I wrote the Python ETL. Its job was intentionally small. Fetch the RSS feed, parse each entry into an Article object, and save the results to PostgreSQL. Nothing more. python

feed = feedparser.parse(RSS_URL)

articles = parse_feed(feed)

save_articles(articles)

That's really all the ETL did. I intentionally kept the application small because the focus of this project wasn't the transformation logic. It was everything that happened around it. Once that worked reliably, I turned my attention to the database. I wanted repeated executions to be safe, so I made the inserts idempotent using PostgreSQL's ON CONFLICT DO NOTHING. That way, running the pipeline multiple times wouldn't create duplicate rows. sql

INSERT INTO articles (...)
VALUES (...)
ON CONFLICT (id) DO NOTHING;

This one line made the pipeline safe to execute repeatedly. Whether Kestra ran the workflow once or one hundred times, PostgreSQL became responsible for preventing duplicate records. Only after the ETL and database worked together did I introduce Docker. That decision changed how I thought about the project. Initially, Docker felt like another tool I needed to learn. By the end of the project, I realized it had become something much more important. It became the unit of execution. bash

FROM python:3.13-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD ["python", "fetch_rss.py"]

Packaging the ETL this way meant the application became self-contained. Instead of asking Kestra to understand my Python project, I could simply ask it to run a container that already knew how to execute the pipeline. Instead of thinking, "Kestra will run my Python script," I started thinking, "Kestra will run my Docker image." That distinction might seem subtle, but it completely changes the relationship between your application and your orchestration layer. Once the ETL was packaged into a container, it no longer mattered whether it ran on my laptop, inside Kestra, or on another machine entirely. The runtime environment was always the same. That consistency gave me something I didn't have before: confidence. Before introducing Kestra, I could run the container manually and verify that it fetched the RSS feed, connected to PostgreSQL, and persisted the expected records. If something failed, I knew the problem wasn't hidden behind another layer of orchestration. That validation step turned out to be incredibly valuable later. During development, I ran into issues with networking, container configuration, and workflow execution. Because the Docker image had already been validated independently, I could immediately rule out the ETL itself and focus on the orchestration layer. That made debugging dramatically easier. Looking back, I think this was one of the biggest lessons from the project. It's tempting to connect every component together as quickly as possible and hope everything works. A better approach is to validate each layer before introducing the next one. In this project, the order looked like this:

Each layer built on the previous one. By the time Kestra entered the picture, I wasn't trying to debug Python, PostgreSQL, Docker, and orchestration at the same time. I was only solving one problem. That incremental approach made the entire project feel much more manageable, and it's a workflow I'll probably continue using on future data engineering projects.

The Assumption That Turned Out to Be Wrong

With a working Docker image, I was convinced the hard part was over.

Now all Kestra had to do was run it. Or so I thought. My original assumption was simple. Kestra would point to my Python files, execute the script, and everything would work exactly as it had from the command line. It didn't. I quickly discovered that there was an important distinction I hadn't fully appreciated. Kestra is an orchestrator. It isn't responsible for building Python environments or managing application dependencies. Its responsibility is deciding when and how workloads should run. That realization changed the direction of the project. Instead of treating Kestra as another place to execute Python code, I started treating it as the layer responsible for orchestrating a workload that already existed. That workload was my Docker image. Once I made that mental shift, the architecture became much cleaner.

Each layer had a clear responsibility, and none of them needed to know how the others worked internally. Interestingly, reaching that point wasn't completely straightforward. My first instinct was to find a way for Kestra to execute the Python project directly. That approach sounded simpler, but the more I experimented with it, the more I realized I was asking the orchestrator to take responsibility for something the application should already provide. Once I embraced Docker as the execution artifact, the workflow became much simpler. Some approaches looked promising at first but introduced unnecessary complexity. Others worked, but didn't align with how Kestra encourages containerized workloads to be executed. Eventually, I landed on a workflow that felt surprisingly simple. Instead of trying to teach Kestra how to run Python, I let Kestra do what it does best. It launches a container. yaml

tasks:
  - id: run_etl
    type: io.kestra.plugin.scripts.shell.Commands

    containerImage: rss-pipeline-etl:latest

    taskRunner:
      type: io.kestra.plugin.scripts.runner.docker.Docker

    commands:
      - python /app/fetch_rss.py

Looking at the workflow now, what stands out isn't how much YAML it contains. It's how little Kestra actually needs to know about my application. Its only responsibility is to launch a container that already knows how to execute the ETL. Inside that container, my application already knows exactly what to do. That small architectural change solved more than just the immediate execution problem. It also reinforced an idea that's becoming a recurring theme in my learning journey. Good engineering often isn't about adding another layer. It's about giving each layer a single responsibility and allowing it to do that job well.

Each component solves a different problem. Once I stopped asking one tool to solve every problem, the entire system became much easier to reason about. Looking back, this was probably the biggest mindset shift in the whole project. I didn't just learn how to use Kestra. I learned what orchestration actually means.

Once a Pipeline Runs Automatically, Everything Changes

Up until this point, I had been running the pipeline manually. If something failed, I was sitting in front of my computer. I could read the error, make a change, and try again. That safety net disappears the moment a pipeline starts running on its own. One of the first things I configured in Kestra was a simple hourly schedule. yaml

triggers:
  - id: hourly_schedule
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "0 * * * *"

On paper, it was just a cron expression. In practice, it represented a much bigger shift. The pipeline no longer depended on me remembering to run it. Every hour, Kestra would start a new execution, launch the ETL container, and process the latest articles from the RSS feed. That immediately raised another question. What happens if one of those executions fails? During development, I deliberately introduced failures to answer that question. I pointed the pipeline at an invalid database host and watched what happened. The first execution failed, exactly as expected. More importantly, it didn't stop there. Because the workflow was configured with retries, Kestra automatically attempted the execution again after a short delay. yaml

retry:
  type: constant
  maxAttempts: 3
  interval: PT30S

That was one of my favorite moments in the project. Once I corrected the configuration, the workflow completed successfully without requiring any changes to the application itself. That was one of my favorite moments in the project. Not because retries are particularly complicated, but because they highlighted another separation of responsibilities. The ETL shouldn't decide whether it deserves another chance. That's an orchestration concern. By moving retry logic into Kestra, the Python application remained focused on a single responsibility: process the feed and persist the results. The orchestration layer handled resilience. Scheduling introduced another challenge that I'd already encountered in my first ETL project. Repeated executions mean repeated attempts to write data. If the same RSS article appears in multiple hourly runs, the pipeline shouldn't insert it twice. Fortunately, I had already solved a similar problem before. The database layer was designed to be idempotent using PostgreSQL's ON CONFLICT DO NOTHING. sql

INSERT INTO articles (...)
VALUES (...)
ON CONFLICT (id) DO NOTHING;

That meant every execution could safely attempt to insert the same records without creating duplicates. The combination of scheduling, retries, and idempotent writes made the pipeline much more forgiving. If a run failed, Kestra could retry it. If a successful retry encountered data that had already been written, PostgreSQL would simply ignore the duplicates. Neither layer needed to know what the other was doing. They each handled their own responsibility. The last improvement was visibility. Early in development, my logs looked exactly like you'd expect from a project that was still being debugged. I printed entire RSS objects to the console just to make sure the parser was working. It wasn't pretty, but it served its purpose. As the pipeline became more stable, those debug statements became less useful. I replaced them with logs that described the execution instead of dumping raw data.

Before

python

print(feed.entries[0])

After

python

print("=== RSS PIPELINE START ===")

first = feed.entries[0]

print("First entry preview:")
print(f"Title: {first.get('title')}")
print(f"Link: {first.get('link')}")

print(f"Feed title: {feed.feed.title}")
print(f"Fetched articles: {len(articles)}")
print(f"Saved {len(articles)} articles to the database.")

print("=== RSS PIPELINE END ===")

Each run now tells a simple story. text

=== RSS PIPELINE START ===

First entry preview:
Title: Christian Ledermann: Migrate From mypy To ty And pyrefly
Link: https://dev.to/...

Feed title: Planet Python
Fetched articles: 25
Saved 25 articles to the database.

=== RSS PIPELINE END ===

Those changes didn't make the application smarter. They made it easier to understand. And that's an important distinction. Good observability isn't about producing more logs. It's about producing the right logs. By the end of the project, I realized something interesting. The Python code hadn't grown dramatically. Most of the work had happened around it. Looking back, most of the engineering effort wasn't spent making the ETL smarter. It was spent making it more reliable.

Individually, none of these changes were particularly complex. Together, they transformed a simple Python script into something that behaved much more like a production system.

The Final Architecture

By the end of the project, the architecture had settled into something that felt surprisingly simple.

Looking at the final architecture, it's tempting to think the project was always heading in this direction. It wasn't. Each layer was added only after the previous one had been validated.

That order mattered. Because every component had already been tested independently, I never found myself debugging Python, Docker, PostgreSQL, and Kestra at the same time. Each decision reduced the number of unknowns instead of increasing them. More importantly, every component ended up with a clear responsibility.

None of those components are trying to do each other's jobs.
Ironically, that's what made the finished system feel much simpler than I expected.

What This Project Changed About the Way I Think

When I started learning data engineering, I assumed the difficult part would be writing ETL code. That's what most beginner tutorials focus on.

Repeat. Those are valuable skills, but they're only one part of the picture.
This project taught me that the engineering begins after the script works. Once a pipeline is expected to run every hour, survive transient failures, avoid duplicate data, and produce logs that explain what happened, the questions become much more interesting. You're no longer thinking about individual functions. You're thinking about systems. One of the biggest mindset shifts for me was understanding the difference between execution and orchestration. At first, those ideas felt almost interchangeable. Now they feel completely separate. The Python application should focus on business logic. The orchestrator should focus on when, where, and how that application runs. Keeping those responsibilities separate made the entire project easier to reason about. It also changed how I think about Docker. Before this project, I saw Docker primarily as a way to package applications. Now I see it as a deployment artifact. Once the ETL had been packaged into a container and validated independently, I could stop worrying about whether it would behave differently inside Kestra. That confidence turned out to be one of the biggest advantages of containerizing the application. Perhaps the most important lesson, though, had nothing to do with Kestra or Docker. It was the value of building incrementally. Every major decision followed the same pattern.

That approach made the project feel much less overwhelming than trying to connect everything together from the beginning.
Looking back, I think that's a lesson I'll carry into every future project, regardless of the technology.

Looking Ahead

This RSS pipeline is only the second project in my data engineering learning journey. Compared to my first ETL pipeline, the code itself isn't dramatically more complex. What changed was the way I approached the problem. Instead of asking, "How do I write this script?", I found myself asking questions like:

Those questions pushed me to think less like someone writing Python code and more like someone designing a system. And I suspect that's the real value of building projects. Every project teaches a new tool. But the best projects slowly change the way you think. This one certainly did. I'm sure the next project will challenge a completely different set of assumptions. Honestly, I'm looking forward to finding out what they are. This is part of my ongoing series documenting my transition from systems analyst to data engineer. If you’ve been following along, thank you. Connect with me on LinkedIn ,YouTube , and Twitter .

Register Now to Continue Reading

Unlock Towards Data Science with a Free Account

All articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more. Register for freeSign in to your account


Written By

Ibrahim Salami

See all from Ibrahim Salami Data EngineerDockerEtlEtl PipelinePython Share This Article

Towards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program. Write for TDS

Related Articles

Turn a Pandas DataFrame into an API

Data Science Share a dataframe with others or integrate the data into a frontend. Eric Green July 5, 20213 min read

How to Build an AI-Powered Weather ETL Pipeline with Databricks and GPT-4o: From API To Dashboard

Data Engineering A step-by-step guide from weather API ETL to dashboard on Databricks Gustavo Santos December 26, 202510 min read

Fourier Transform, Applied (3): Magnitude and phase encoding in complex data

Machine Learning Magnitude and phase encoding in complex data Peter Barrett Bryan December 25, 20213 min read

5 Essential Tips to Improve the Readability of Your Python Code

Improving your Python Code Through Documentation, Type Hinting and Proper Variable Names Andy McDonald July 22, 20227 min read

Manage dev and prod using terraform and local yaml files

Programming Turn your terraform to spin in multiple projects using yaml Daniel Low June 24, 20243 min read

Exploratory Data Analysis: Gamma Spectroscopy in Python (Part 3)

Data Science Let’s observe the matter on the atomic level Dmitrii Eliuseev August 5, 202515 min read

PySpark on Google Colab 101

Data Engineering A Beginner's Hand's on Guide to PySpark with Google Colab Garvit Arya July 4, 20214 min read

Efficient Metric Collection in PyTorch: Avoiding the Performance Pitfalls of TorchMetrics

Machine Learning PyTorch model performance analysis and optimization—Part 7 Chaim Rand February 6, 202512 min read

The 5 Most Popular SQL Transforms

Programming Analyzing the usage of SQL Generator Josh Berry September 20, 20224 min read

Your home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals. Subscribe to Our NewsletterWrite For TDS•About•Advertise•Privacy Policy•Terms of Use © Insight Media Group, LLC 2026•The New Stack•roadmap.sh•Creator Network

Recommended Articles

Close