Databases & Storage

Storage Tiering Explained: Hot, Warm and Cold Data on a VPS

By NileVPS Team · Published · 5 min read

اقرأ المقال بالعربي

Not all data deserves the same storage. The orders placed in the last hour are read constantly; the invoices from three years ago are opened a few times a year, if ever. Keeping both on the same fast, expensive disk wastes money, while keeping both on slow storage hurts performance. Storage tiering is the practice of placing each kind of data on the storage class that matches how often it is used. This guide explains the idea, how to apply it on a VPS, and the mistakes to avoid.

What hot, warm and cold mean

Tiers are defined by access pattern, not by how important the data is.

  • Hot data is read or written constantly: active database tables, current sessions, application code, recent uploads. It needs low latency and high IOPS.
  • Warm data is used occasionally: last month's reports, older product images, logs from recent weeks. It should be reachable quickly but does not need the fastest disk.
  • Cold data is rarely touched but must be kept: old backups, archived logs, compliance records. It needs to be cheap, durable and retrievable, even if retrieval is slow.
TierTypical storageAccess speedCost per GBExample data
HotLocal NVMe, RAM cachesVery fastHighestLive database, sessions
WarmAttached block volumes, SSDFastMediumRecent logs, older media
ColdObject storage, archive storageSlowerLowestOld backups, archives

Why tiering matters on a VPS

On a VPS, the fast local disk is usually the most limited resource for its price. When it fills up with old logs and backups, you are pushed into a bigger plan you may not need for CPU or RAM. Tiering lets you keep the local disk for work that benefits from speed and move the rest elsewhere. It also improves performance indirectly: a smaller hot dataset is more likely to fit in RAM and the page cache, so fewer reads reach the disk at all.

Designing your tiers

Step 1: measure what you actually store

Before moving anything, find out where the space goes:

df -h
sudo du -xh --max-depth=2 / 2>/dev/null | sort -rh | head -20

For access patterns, check when files were last modified. This lists files under /var/www/uploads not changed in 180 days:

find /var/www/uploads -type f -mtime +180 | head

Note that many systems mount filesystems with relatime, so access times are only updated approximately. Modification time is usually the more reliable signal.

Step 2: define simple rules

Good tiering rules are boring and predictable, for example:

  • Database data files and the application stay on local NVMe.
  • Logs older than 14 days are compressed; older than 90 days are moved to object storage.
  • Daily backups stay locally for 3 days, then live only in off-server storage.
  • User uploads older than a year move to object storage and are served from there.

Step 3: automate the moves

Manual tiering is forgotten within a month. Use the tools you already have:

  • logrotate compresses and removes old logs. Settings such as rotate 14, compress and maxage 90 in a file under /etc/logrotate.d/ handle most cases.
  • rclone copies files to S3-compatible object storage. A cron job like the one below moves backups older than three days:
0 3 * * * rclone move /backups remote:server-backups --min-age 72h --log-file /var/log/rclone.log
  • Application-level tiering is often the cleanest: many frameworks can store uploads on an S3-compatible disk directly, so the web server never keeps old media locally.

See our cron jobs guide for scheduling details.

Tiering inside databases

Databases benefit from the same thinking. Large tables that only grow, such as events, audit logs and order history, can be split so recent rows stay small and fast:

  • Partitioning: PostgreSQL declarative partitioning (PARTITION BY RANGE on a date column) and MySQL range partitioning let you keep recent partitions hot and detach or archive old ones without heavy DELETE operations.
  • Archive tables: periodically move closed records into a separate archive table or database, then export it to cold storage.
  • Tablespaces: PostgreSQL tablespaces can place specific tables on a different volume, for example an attached block volume for rarely queried history.

Always test restore paths. Data in cold storage is only useful if you can bring it back when someone needs it.

Common mistakes

  1. Tiering by importance instead of access. Critical but rarely read data, like legal archives, belongs in cold storage with strong durability, not on the fastest disk.
  2. Forgetting retrieval cost and time. Archive storage can be slow or charge per retrieval. Make sure that is acceptable for the data you put there.
  3. No single source of truth. Know exactly where each class of data lives. Document the rules next to the scripts that enforce them.
  4. Breaking the application. If old uploads move, the URLs that point to them must still work, through redirects, a proxy rule or the application's storage driver.
  5. Treating a tier as a backup. Moving data to object storage is not the same as backing it up. Keep backups separate and versioned.

With simple, automated rules and a monthly look at df -h, many projects stay on a smaller plan for longer. Compare plan disk sizes on our pricing page.

FAQ

Is storage tiering only for large companies?

No. Even a single VPS benefits from simple rules: logs compressed and expired, backups sent off-server, and uploads stored in object storage. The same idea scales from one server to many.

Does moving data to cold storage make it slower to use?

Yes, retrieval from cold storage is usually slower and sometimes costs more per request. That is the trade-off, so only move data that is rarely accessed and whose retrieval time is acceptable.

How often should tiering rules run?

For logs and backups, daily is typical. For uploads and database archiving, weekly or monthly is often enough. The right schedule depends on how fast the data grows and how much free disk space you keep.

Related guides