gitwtfhub

wtf is scdb?

hadley/scdb — explained in plain English

Analysis updated 2026-08-07 · repo last pushed 2026-05-14

2Audience · dataComplexity · 3/5MaintainedSetup · moderate

TL;DR

SCDB is an R package for tracking how data changes over time in databases. It keeps old and new versions of records with date ranges, so you can see what your data looked like at any point in the past.

Mindmap

mindmap
  root((repo))
    What it does
      Tracks data changes
      Preserves old versions
      Date-range validity
    Tech stack
      R
      SQL databases
      CRAN package
    Use cases
      Health record tracking
      Customer address history
      Product price changes
    Audience
      Data analysts
      Data engineers
      Researchers
    Source
      Statens Serum Institut
      Denmarks public health

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Maintain a patient health database where you can look up someone's medical status at any past date.

REASON 2

Build a customer database that keeps a full history of address and contact changes over time.

REASON 3

Track product price updates in a database while preserving every previous price with validity windows.

REASON 4

Create a research dataset that records how population attributes shift across time periods.

What's in the stack?

RSQLCRAN

How it stacks up

hadley/scdb0-bingwu-0/live-interpreter010zx00x1/faresnipe
Stars222
LanguagePythonPython
Last pushed2026-05-14
MaintenanceMaintained
Setup difficultymoderatemoderateeasy
Complexity3/52/52/5
Audiencedatageneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires an existing SQL database connection and familiarity with R database workflows plus slowly changing dimension concepts.

No license information is provided in the README, so usage terms are unknown.

Wtf does this do

SCDB is an R package that helps you maintain databases where the underlying data changes over time. The core benefit is tracking "slowly changing dimensions", a concept from data warehousing that means when a record changes (like a customer moving to a new address or a product getting a price update), you keep the old version and the new one, each with a time range showing when it was valid. Instead of overwriting the old data and losing history, you end up with a full record of how things looked at any point in the past. The package implements what's called "type-2 history," a standard approach where each row gets a validity window, a start date and end date indicating when that version of the data was current. When new data arrives, expired rows get closed off and new rows are inserted. SCDB also bundles some quality-of-life helpers for working with SQL databases from within R, reducing the boilerplate you'd normally write. This would be useful for analysts, data engineers, or researchers working in R who need to maintain a database that preserves change history. A concrete example: if you work at a health organization tracking patient or population records where attributes shift over time, you'd want to know what someone's status was last year versus today, not just the current state. The package is published on CRAN (the main R package repository) and comes from Statens Serum Institut, Denmark's public health institute. The README is fairly sparse and points to vignettes for actual usage examples and deeper explanation of the slowly changing dimension concept. If you're comfortable in R and need historical tracking in your database workflows, that's where you'd start.

Yoink these prompts

Prompt 1
I need to track slowly changing dimensions in an R database workflow. Show me how to use the SCDB package to maintain a table where old records are preserved with validity date ranges when new data arrives.
Prompt 2
Help me set up type-2 history tracking with SCDB in R. I have a table of customer records that change over time and I want each update to close out the old row and insert a new one with start and end dates.
Prompt 3
Using the SCDB R package, write code that connects to a SQL database, loads a data frame, and updates a slowly changing dimension table so I can query what any record looked like at a specific past date.
Prompt 4
I work with health records in R that change over time. Show me how to use SCDB to store patient status history so I can compare someone's status today versus a year ago.

Frequently asked questions

wtf is scdb?

SCDB is an R package for tracking how data changes over time in databases. It keeps old and new versions of records with date ranges, so you can see what your data looked like at any point in the past.

Is scdb actively maintained?

Maintained — commit in last 6 months (last push 2026-05-14).

What license does scdb use?

No license information is provided in the README, so usage terms are unknown.

How hard is scdb to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is scdb for?

Mainly data.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.