Back to Blog
Data Time Travel with PostgreSQL — Shayntech TimeTravel
May 9, 2025 8 min read Shayntech Engineering

Data Time Travel with PostgreSQL: Query Your Database as It Existed at Any Point in Time

What if you could run a SELECT query against your production database and see exactly what the data looked like six months ago — down to the millisecond? Not a backup restore, not a guess from logs. An actual, verifiable, point-in-time snapshot.

This isn't science fiction. It's Shayntech TimeTravel — an open-source tool that gives PostgreSQL databases git-like version control. Every INSERT, UPDATE, and DELETE is captured in an immutable SHA-256 hash chain, then made queryable through a simple time-travel syntax.

And yes, it comes with a professional dashboard, SOC 2 evidence reports, and chain verification built in. Let's dive in.

The Problem: Databases Have No Undo Button

Every company that stores data in a database has the same nightmare scenario: an errant DELETE FROM users without a WHERE clause. A corrupted migration. A bad deployment that silently overwrites critical records. A compliance auditor who asks: “Prove to me that this data wasn't tampered with.”

Traditional solutions are inadequate:

  • Manual backups capture snapshots, but you lose all changes between backups
  • Database logs record events but not the state of the data at a given moment
  • Point-in-time recovery (PITR) restores an entire cluster, not a single table or row
  • Application-level audit trails are only as reliable as the app that writes them

What you actually need is git for your database — and that's what TimeTravel provides.

Shayntech TimeTravel Enterprise Dashboard — overview analytics

How TimeTravel Works: The Immutable Hash Chain

At its core, TimeTravel is a change data capture (CDC) system with a cryptographic backbone. Here's how it works:

  1. Track a table: Run timetravel track users and TimeTravel creates a shadow history table with database triggers.
  2. Every change is recorded: When data is INSERTed, UPDATEed, or DELETEd, the trigger saves the old + new values along with a SHA-256 hash of the entire change record.
  3. Hash chain is maintained: Each new transaction includes the previous entry's hash in its own hash. Modifying any past record breaks every subsequent hash — instantly detectable.
  4. Query any point in time: The Enterprise Dashboard lets you select a date/time and see the exact state of your database at that moment.
  5. Verify the chain: Run chain verification to get a PASS/FAIL result with detailed evidence of every entry's integrity.

# Track a table and see its history

$ timetravel track users

# Result: immutable hash chain

Entry #1: SHA256(insert:Alice) → hash_1

Entry #2: SHA256(update:Bob + hash_1) → hash_2

Entry #3: SHA256(delete:Carol + hash_2) → hash_3

# Any tampering breaks the chain

Time Travel Queries: See Data as It Was

The killer feature is the time travel query interface. Through the Enterprise Dashboard, you can select any table and any timestamp, and TimeTravel reconstructs the exact database state at that moment. Results are displayed as a clean, sortable table — not raw JSON.

Use cases include:

  • Forensic analysis: What was this user's role on Jan 15?
  • Rollback planning: Show me the order table before yesterday's deployment
  • Compliance queries: Prove that records were correct at audit date
  • Data archaeology: Recover data that was deleted three months ago
Time Travel Query Interface — select table and timestamp

SOC 2 Evidence Reports: Audit-Ready Compliance

One of the most painful parts of SOC 2 Type II audits is gathering evidence. You need to prove that your data hasn't been tampered with, that change controls are working, and that retention policies are being followed. TimeTravel generates all of this automatically.

The Report Center includes four auditor-ready report types:

ReportSOC 2 ControlsWhat It Proves
Data IntegrityCC6.1, CC6.6No data has been tampered with
Change AuditCC7.2Every change is logged + traceable
RetentionA1.2, A1.3Data exists at the right retention period
Compliance SummaryCC6.1–A1.3Full SOC 2 coverage with auditor statements
SOC 2 Report Center in Shayntech TimeTravel Enterprise Dashboard

Chain Verification: Tampering Is Instantly Detectable

The hash chain verification is the crown jewel of TimeTravel's security model. With one click, the system re-hashes every entry in the chain and compares it to the stored hash. If even a single byte has been modified — by an attacker, a rogue admin, or a bug — the chain reports a FAIL with detailed information about exactly which entry broke.

This is the same cryptographic principle that makes blockchain technology secure, applied to your database. No special infrastructure needed. No cryptocurrency involved. Just SHA-256, PostgreSQL triggers, and a clean dashboard.

Architecture: Runs on Your Infrastructure

TimeTravel is designed for zero data transfer. The entire system runs on your own infrastructure — your server, your Docker container, your cloud VPC. We never see your data. The open-source code is fully auditable.

Deployment options:

  • Docker: docker-compose up -d — dashboard live in 5 minutes
  • Bare metal: Install via pip, connect to any PostgreSQL instance
  • SQLite (Free Edition): Perfect for development, testing, and small deployments
  • PostgreSQL (Enterprise): Production-grade with full time-travel query support

TimeTravel vs. Other Approaches

FeatureTimeTravelPITR (PostgreSQL)Custom Audit Logs
Query any past state✅ Single query❌ Full cluster restore⚠️ Manual reconstruction
Tamper detection✅ SHA-256 chain❌ None❌ None
SOC 2 evidence✅ Auto-generated⚠️ Manual reports
Per-table granularity✅ Yes❌ Whole cluster✅ If implemented
Zero data transfer✅ Runs on-prem✅ Same server✅ Depends on setup
Open source✅ MIT License✅ Built-in⚠️ You build it
Chain Verification Dashboard — PASS/FAIL with detailed evidence

Getting Started: From Zero to Time Travel in 5 Minutes

  1. Install TimeTravel: pip install shayntech-timetravel
  2. Run the demo: timetravel demo — creates a sample database with simulated changes
  3. Launch the dashboard: docker-compose up -d
  4. Open the dashboard: Navigate to http://localhost:8080
  5. Run your first time travel query: Select a table and a past timestamp — see your data as it was.

For PostgreSQL production deployment, set the TT_PG_CONNECTION environment variable to your connection string:

# PostgreSQL deployment

$ export TT_PG_CONNECTION="postgresql://user:pass@host:5432/mydb"

$ docker-compose up -d

Who Should Use TimeTravel?

CTOs & Engineering Leaders: Add database version control to your stack. Sleep better knowing every production change is captured and verifiable.

Compliance Officers & Auditors: Generate SOC 2 evidence reports in seconds instead of weeks of manual log gathering.

Data Engineers & DBAs: Debug data issues by querying past states. Recover from bad deployments without full database restores.

Startups & Scale-ups: Get SOC 2 ready from day one. Don't wait until an auditor asks for evidence to start tracking changes.

The Bottom Line

Databases are the most critical infrastructure in any modern business, and they've been running without version control for decades. Shayntech TimeTravel changes that. It gives you the power to query the past, detect tampering instantly, and generate SOC 2 evidence automatically — all without sending your data anywhere.

The Free Edition is open source under the MIT license. The Enterprise Edition adds the professional dashboard, PostgreSQL support, SOC 2 reports, and priority support. Both are available now.

Ready to add time travel to your database? Get started at shayntech.com/products/timetravel or clone the GitHub repo and start querying the past.


Shayntech is an AI consulting and software company dedicated to making advanced infrastructure accessible to every team. TimeTravel is one of several open-source tools we've built to help companies build better, more reliable data systems.

Ready to time travel?

Get started with the free open-source edition or deploy the Enterprise Dashboard.