News for hackers. Stuff that matters.
Re:How PostgreSQL aggregation works and how it inspired our ... by oconnor663 on Thursday August 05, 2021 @01:39PM (#28076982)
Noob question: Can you have time-series tables and regular Postgres tables in the same database? Is this distinction something that you decide on when you create a table?
Re:How PostgreSQL aggregation works and how it inspired our ... by noctarius on Thursday August 05, 2021 @01:44PM (#28077043)
Yes you can have both in the same database. We actually use TimescaleDB exactly that way, well at least for now. We'll in the process of separating certain tables out, so make it possible to select a pg database based on async or sync replication.

In terms of creating a Hypertable (TimescaleDB table) you create the normal table first and then transform it into a Hypertable.

Re:How PostgreSQL aggregation works and how it inspired our ... by clarkbw on Thursday August 05, 2021 @02:57PM (#28077973)
> ... make it possible to select a pg database based on async or sync replication

Can you explain why you doing this? Is this application data vs. time-series?

Re:How PostgreSQL aggregation works and how it inspired our ... by takeda on Thursday August 05, 2021 @05:11PM (#28079910)
Not op, but choosing async vs sync replication is typically done around guarantees. Async (the default mode) is generally preferred in most cases as it adds relatively small overhead. The problem with it, is that if something happens to master, the standby node might be behind (i.e. some data might be lost).

Sync on the other hand won't return from the transaction until the change is replicated.

For time series, generally async is acceptable, and even for regular data most people might also be fine with async (that's why it is the default). Sync is used if you absolutely aren't allowing any data loss. But because it waits for all nodes to confirm they wrote data to the disk writing will always be slower.

The problem is that if you use physical replication it applies to all data in the database (the logical resource not the physical server), so my guess is that some of the non-time series data has higher durability requirements.

Re:How PostgreSQL aggregation works and how it inspired our ... by claytonjy on Thursday August 05, 2021 @01:46PM (#28077066)
Yes you can, and yes you make the decision table by table. 'CREATE TABLE` is the same in either case, then `create_hypertable` to make it a timeseries table https://docs.timescale.com/api/latest/hypertable/create_hype...
Re:How PostgreSQL aggregation works and how it inspired our ... by miohtama on Thursday August 05, 2021 @05:08PM (#28079864)
I have been using TimescaleDB with Python, SQLAlchemy for a mixed timeseries and normal relational workload. The only issue I have encountered so far is that pq_restore needs some special, easy, wrapping. TimescaleDB is just an extension to PSQL.
Re:How PostgreSQL aggregation works and how it inspired our ... by GordonS on Thursday August 05, 2021 @01:48PM (#28077104)
Yes! It's a nice benefit of TimescaleDB being built on top of Postgres.
Re:How PostgreSQL aggregation works and how it inspired our ... by pvorb on Thursday August 05, 2021 @05:05PM (#28079821)
And it's the feature that sets Timescale apart from other, NoSQL, time-series databases. With Timescale you can have all your data in the same database and join regular tables against hypertables or do other useful stuff directly in the database.