Live Compression Software (LCS)

Keep every row. Store the old ones in a fraction of the space.

Most of a busy table is old rows: rarely read, never allowed to disappear. LCS keeps your recent rows exactly as they are and moves rows older than an age you choose into compressed blocks, in a table beside the original, in the same PostgreSQL, MySQL or MariaDB database. No new database, nothing to migrate to, nothing to install: you set it up from your DBShifts account, and DBShifts compacts the table on the schedule you choose.

Archiving moves the problem

Old rows go to another table, database or bucket. The space comes back, and then someone needs last year's order and has to know where it went.

Whole-table compression taxes the hot rows

Page compression shrinks the whole table, so the rows read and written all day pay for it on every access — to save space on rows that are hardly touched.

Measured, not promised

A 200,000-row, 17-column orders table with a quarter of its rows still recent, on disk after VACUUM FULL or OPTIMIZE TABLE, compressed with the Rust codecs. Your ratio depends on your data — measure yours first, which changes nothing.

2.8×

smaller on disk, PostgreSQL 16

54.3 MB → 19.7 MB

2.4×

smaller on disk, MySQL 8.4

50.9 MB → 21.0 MB

2.3×

smaller on disk, MariaDB 11.8

48.8 MB → 21.0 MB

≈ 5×

smaller for the compressed rows

29.6 MB of values → 5.6–6.0 MB stored

Reading a compressed row by key took 2.5–4.1 ms at the median, database round trip included, and compaction moved 6,900–11,400 rows a second, writes included, on a laptop running the databases in Docker. The compressed blocks were 1.4–1.6× smaller than the same rows exported as CSV and compressed with xz. Measured November 2026.

How it works

1

Measure

read-only

Connect the database and pick a table. LCS reads a sample and reports what it would store next to the table's own size. Nothing changes.

2

Enable

Start compressing

Checks the table can be handled exactly, test-encodes a sample, and creates two tables beside it: one for blocks, one for rows changed after they were compressed.

3

Compact

every 15 min to daily

DBShifts moves rows older than the age you set into compressed blocks of about 1,000 rows, on the schedule you choose or when you press the button. Each block is written and its rows deleted in one transaction.

4

Read and change

find · edit · delete

Any row by key or key range, wherever it lives, in one consistent snapshot of the table and the blocks — from your DBShifts account.

5

Undo

Disable

Puts every row back into the table exactly and removes LCS's own tables. Safe to run again if it is interrupted.

What it does

Exact, value for value

Every block is decoded and compared with its rows before it is written — float bits, a decimal's scale (1.10 stays 1.10), a timestamp's UTC offset. Each column carries a checksum, and Verify re-checks every block.

Same database, no new system

Blocks live in a table beside the original, so backups, replication and permissions you already have cover them. Nothing to install on the server.

Your application keeps writing

New rows go into the table exactly as before. Compaction only takes rows past the age you set, and skips rows another transaction is changing at that moment.

Safe to stop at any point

A crash mid-compaction rolls back the block it was writing, so every row is in exactly one place. Two compactions never run on one table at once, and Disable stops a running compaction before it starts restoring.

Updates and deletes still work

A compressed row can be updated or deleted. An update writes the row back to the table and applies the same UPDATE a recent row gets, so ON UPDATE columns and UPDATE triggers behave as usual.

Narrow rows compress too

Rows are stored column by column: sorted ids and timestamps as small differences, repeated text as a dictionary, then zlib or lzma. PostgreSQL's TOAST never compresses rows under about 2 KB; LCS does.

Codecs in Rust

Encoding and decoding run in Rust, byte for byte the same as a Python reference implementation that stays as the fallback. A damaged block raises an error instead of returning wrong data.

Your rows stay in your database

DBShifts connects to your database to do the work, the way Migration does. Rows pass through only while they are compressed, read or restored; the blocks are kept in your database, not by DBShifts.

No AI involved

Every encoding is a fixed, deterministic algorithm. The same rows give the same block every time.

Run from your DBShifts account

Connect the database, or pick one you already connected in Data Console, choose the table, the age and the schedule. The page shows how many rows are in the table and how many are compressed, the sizes on disk, each run, and finds any row by key — to read it, change it or delete it. Verify re-checks every block; Disable puts every row back.

What version 1 needs

LCS refuses a table it cannot keep exact, and says which of these it failed — nothing is created until they all hold.

  • PostgreSQL, MySQL or MariaDB (tested on PostgreSQL 16, MySQL 8.4 and MariaDB 11.8).
  • A single-column integer primary key.
  • A date or timestamp column that says how old a row is.
  • No other table referencing it by foreign key, and no INSERT or DELETE triggers — moving a row deletes it from the table and writing it back inserts it. UPDATE triggers are fine.
  • Rows already in blocks are read and changed from your DBShifts account, not with plain SQL. Recent rows stay ordinary rows.
  • A database DBShifts can reach (directly, or through an SSH bastion) and a user that can create tables in it and read, insert and delete rows in the table.

Guides: keeping old rows small

What PostgreSQL, MySQL and MariaDB already give you, and when each approach fits — LCS or not.

Frequently asked questions

What is Live Compression Software (LCS)?

LCS is a DBShifts service that keeps a table's recent rows as they are and stores rows older than an age you choose in compressed blocks, in a table beside the original in the same PostgreSQL, MySQL or MariaDB database. You set it up from your DBShifts account, DBShifts compacts the table on the schedule you choose, and every row stays readable and changeable by key.

How much space will it save?

It depends on the data. On our 200,000-row test table with a quarter of the rows still recent, the whole table took 2.3–2.8× less disk, and the compressed rows about a fifth of their values' size. Sorted keys, timestamps and repeated text shrink most; random ids, hashes and already compressed data barely shrink. Measuring a table on the setup page reads a sample of your own rows and reports it without changing anything.

Can my application still query old rows with SQL?

Not once they are compressed. Compressed rows are read and changed from your DBShifts account, by key or key range, in one snapshot with the recent rows. Recent rows stay ordinary rows for plain SQL. If your application must keep reading old rows with SQL, set the age higher, or leave that table alone.

Is this the same as PostgreSQL TOAST compression?

No. TOAST compresses individual large values once a row passes about 2 KB, so a typical row of ids, amounts and timestamps is never compressed. LCS compresses whole groups of rows column by column, which is what makes narrow rows small.

How is it different from InnoDB page compression?

InnoDB compression works on the whole table, so recent rows — the ones read and written all day — pay for it on every access. LCS leaves recent rows untouched and compresses only rows past the age you set.

What happens if compaction crashes halfway?

Each block is inserted and its rows deleted in one transaction, so a crash rolls that block back and every row is in exactly one place. Our end-to-end test kills a compaction between the two steps and checks that nothing was lost or doubled.

How do I undo it?

Press Disable. It moves every live row back into the table and drops LCS's tables, one block per transaction. If it is interrupted, run it again. If a block is damaged, it stops at that block, names it, and keeps everything until the block is restored.

Does my data go through DBShifts?

While it is worked on, yes. DBShifts connects to your database from its servers, the way Migration does, so rows pass through its workers while they are compressed, read on the page or restored. They are not stored by DBShifts: the blocks are in your database. DBShifts keeps the connection (the password encrypted), your settings and the history of runs, and every row read or change made from the page is in your audit log.

Which databases and tables does it work with?

PostgreSQL, MySQL and MariaDB, with a single-column integer primary key and a date or timestamp column. It refuses tables that other tables reference by foreign key or that have INSERT or DELETE triggers, and says why.

How do I start?

Create a free DBShifts account, open Live Compression, connect the database and measure a table. Nothing in the database changes until you press Start compressing.

Keep the history. Drop the weight.

For PostgreSQL, MySQL and MariaDB. Measure a table first; nothing changes until you enable it.