Data engineering consulting: building event pipelines with Kafka, Airflow and AWS

How Bitscorp approaches a data engineering engagement: contracts first, Kafka for events, Airflow for batch, AWS for processing, and a warehouse your team can trust. Lessons from a 10M+ events/day platform.
5 min read
#dataengineering#kafka#airflow#aws#python#bigquery#postgres

Data engineering consulting: building event pipelines with Kafka, Airflow and AWS

Most teams that ask for "a data platform" want something smaller and more useful: numbers that agree with each other on Monday morning. This post describes how we run a data engineering engagement at Bitscorp, and what we learned building the in-house analytics platform at Blastworks, which processed more than 10 million events per day with Python, Airflow, Kafka, and AWS.

If you want the short version: we sell this as data engineering consulting, and the full story of the platform is in the Blastworks case study.

Start with contracts, not tools

The first week is not about Kafka or Airflow. It is about writing down three things:

  1. The events. Name, owner, required fields, and the grain. "A purchase" is not a contract; "one row per store transaction, keyed by transaction id, with currency and amount in minor units" is.
  2. The metrics. Five to ten numbers that would change a decision this quarter, with the exact definition. DAU, retention, payback by campaign, whatever you actually use.
  3. The sources of truth. Which system wins when two of them disagree.

When those are frozen in writing, the tooling choices get easy. When they are not, no amount of infrastructure will make the dashboard trustworthy.

Collect events once, in one shape

Blastworks needed an in-house platform rather than a patchwork of vendor tools. We built a custom SDK for event collection and a Go backend, so events landed in one schema in a platform the team owned, next to the integrations with Adjust, CleverTap, and Leanplum.

The same pattern works at any size:

  • A thin client library or server-side tracking call that validates the schema early.
  • An ingestion endpoint that accepts batches, stamps a receive time, and never blocks the app.
  • Vendor integrations downstream of your own copy, not instead of it.

Kafka for the stream, Airflow for the batch

We use Kafka when events arrive continuously and several consumers need them: the warehouse loader, a fraud or anomaly check, a realtime counter. It decouples producers from consumers and gives you replay when a consumer has a bad day.

Airflow handles everything that runs on a schedule: hourly and daily loads, rollups, backfills, vendor exports, and data quality checks. A few rules keep DAGs healthy:

  • Idempotent tasks. Every task can run twice for the same interval and produce the same result. Partition by date and overwrite the partition rather than appending.
  • Small tasks. One task, one responsibility, so a retry does not redo an hour of unrelated work.
  • Freshness checks as tasks. If yesterday's partition is late or row counts drift from the source, the DAG fails loudly instead of publishing a wrong number.

If you already run Luigi or Dagster and it is healthy, keep it. The rules are the same.

Process on AWS without paying for idle

For heavy processing at Blastworks we used Amazon EMR, with ELK for search over logs and events. Two cost habits mattered more than any single tuning trick:

  • Spot capacity for batch. Batch jobs that can be retried are ideal for Spot instances; using them is how the Blastworks platform cut its infrastructure cost.
  • Clusters that exist only while jobs run. Let the orchestrator start the cluster, run the steps, and tear it down.

Smaller teams often do not need EMR at all. Postgres, DuckDB, or BigQuery with partitioned tables will carry a surprising amount of load.

A warehouse people can defend

The warehouse is where the metric contracts from week one become tables. We default to BigQuery or Postgres, and model in layers: raw (exactly what arrived), cleaned (typed, deduplicated), and marts (one table per question the business asks). Dashboards in Metabase, Tableau, Looker Studio, or Grafana read only from marts.

Every mart gets a short description of where its numbers come from, and every important number has a test: row counts against the source, sums that must reconcile, and a rule for late-arriving data.

Then, if it helps, the AI layer

Once the data is reliable, putting an assistant on top becomes realistic. At Blastworks we added an internal RAG knowledge assistant so people could ask questions in plain language and get answers with sources. The order matters: retrieval over messy data produces confident nonsense. We cover that side in AI engineering consulting.

How an engagement usually runs

  • Week 1: pipeline audit. Map every source, job, and table. Find duplicates, schema drift, PII exposure, and the most expensive queries. Ship one fix.
  • Weeks 2 to 4: one named pipeline. Sources into a warehouse you own, with orchestration, freshness checks, and one dashboard.
  • After that: a retainer, if you want one. We keep the spine alive, add sources, and grow the platform only when the numbers justify it.

We work from Barcelona (CET) with teams across the EU and remotely worldwide, inside your cloud account and repositories. If that sounds like what you need, read more on the data engineering consulting page or get in touch.