TimescaleDB Architecture

Published
Length
3 min read

Luis Felipe Dias

All posts

The timescaledb architecture works as an extension inside standard PostgreSQL databases. It breaks big time-series tables into smaller tables called chunks by time. Engineering teams set up this system to store sensor logs, metrics, and user events. Teams often create one shared database role for their whole app and staff. When roles have broad rights, one bad query can read or drop all chunks. How the timescaledb architecture stores and queries data TimescaleDB runs right inside the PostgreS

Zero Trust Architecture: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

The timescaledb architecture works as an extension inside standard PostgreSQL databases. It breaks big time-series tables into smaller tables called chunks by time. Engineering teams set up this system to store sensor logs, metrics, and user events. Teams often create one shared database role for their whole app and staff. When roles have broad rights, one bad query can read or drop all chunks.

How the timescaledb architecture stores and queries data

TimescaleDB runs right inside the PostgreSQL engine instead of as a separate database. Users interact with a single logical table called a hypertable for all queries. Behind the scenes, the engine splits incoming rows into child tables called chunks. Each chunk holds data for a specific time window, like one day. This setup keeps recent indexes small enough to fit inside server memory.

When an app sends a write request, the planner routes it to the right chunk. Recent data stays in fast row format so inserts happen fast. Older chunks can move to a columnar format to save disk space. A background scheduler runs jobs to compress old chunks and drop expired data. When a user runs a read query, the planner skips chunks outside that time range.

How native roles work in a hypertable setup

Because the system builds on PostgreSQL, it uses standard database roles and grants. An admin grants read or write permissions on the main hypertable to a role. Those permissions apply down to the child chunks that hold the raw rows. Teams also manage background worker jobs that need owner rights on the tables. Most teams create a few static roles for apps, analysts, and on-call engineers.

Admins often share these static passwords across many scripts and team members. Rotating a password means updating every app and telling every engineer on the team. To avoid breaking background jobs, teams give these shared roles wide table permissions. Soon, many people can log in with the same high-level database role. Database logs then show the shared role name instead of the real person.

Zero Trust Architecture: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native setup solves and the gap it leaves

Native roles and chunking solve the hard parts of storing fast time-series data. The chunk model keeps write speeds stable as your total data grows large. Built-in grants let you decide which role can log in to a database. You can block a reporting role from dropping tables or changing compression rules. These controls work well at the table level when someone first connects.

Still, native setup only checks who logs in, not what queries do in flight. A developer with read rights can still scan every chunk across ten years. That single unbounded query can max out disk reads and stall live writes. Also, chunks often hold user events with emails, phone numbers, or card numbers. Standard grants cannot rewrite those fields in query results or require approval for deletes.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Is TimescaleDB a separate database from PostgreSQL?

No, it runs as an extension inside a standard PostgreSQL server instance. You keep using standard SQL, existing tools, and regular PostgreSQL roles.

How do permissions work on hypertables and chunks?

Admins set grants on the parent hypertable using normal database role rules. The engine applies those access rules when queries read from the child chunks.

Why do time-series queries still expose sensitive user data?

Event and log tables often store raw emails, phone numbers, or card numbers. Once a role has read access, standard queries return all columns in clear text by default.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.