Courses / Course 08

Streaming and Change Data Capture

Data that arrives every second, and changes that must be captured as they happen.

  • AdvancedLevel
  • about 1.5 hoursTo complete
  • 5 lessonsWith checked exercises
  • FreeNo account needed

What you will learn

  • Read CDC events: operations, log positions and timestamps
  • Rebuild current state from a stream
  • Handle out-of-order and late events
  • Count events in time windows
  • Build a full history table from CDC

Syllabus

  1. 1
    Events, not tables

    Change data capture turns every insert, update and delete in a database into an event.

    12 min
  2. 2
    Rebuilding the current state

    Turn a stream of changes back into a table: the latest event per key wins, and deletes remove the row.

    16 min
  3. 3
    Out-of-order and late events

    Events do not always arrive in the order they happened. Plan for it.

    16 min
  4. 4
    Windows and live metrics

    Count events in time windows, and measure how long things take.

    14 min
  5. 5
    Mini project: full order history from CDC

    Turn the stream into a history table, then find orders that got stuck.

    18 min

The data you will use

Nordic Shop raw feeds

The same Nordic Shop, but before anyone cleaned the data. Every night a job loads the day's orders from the shop system, the payment provider sends its own file, and the customer system keeps a log of every change to a customer.

Tables: raw_orders_feed, payments, customer_history, order_events, customer_contacts, deletion_requests

The lesson Events, not tables walks you through every table and column. Under every code box you can also open a list of the tables and what each column means.

Learn in public on GitHub

Do the exercises in the browser, or in the public course repo so your work shows on your GitHub profile.

  1. Fork the course repo

    One click on GitHub gives you your own copy with every exercise and dataset.

  2. Solve and open a pull request

    Put your answers in your own folder and open a pull request. A bot checks them and comments with ✅ or ❌.

  3. Join the graduates

    Finished a course? Add your name to GRADUATES.md. Your work stays on your GitHub profile for recruiters to see.

Open this course on GitHub →

What you will build

Rebuild the shop's orders and their full status history from a change stream.

Based on a real project: E-commerce CDC Pipeline