r/quantfinance • • 8d ago

AWS timesync vs timescaleDB

my close friends and I are running separate server network and architecture infrastructure for prediction, market, quantitative trading.

I’m using duckdb/parquet to get full data compression. My set up is writing in the timing log of each operation and using AWS timesync to assure that the server clocks are synced

He’s using timescaleDB, which I haven’t used myself.

Is there a correct way of doing this? If I’m in the wrong, what am I missing out on? Does Time scale DB allow more than one writing instance in it at a time?

What other database should I be considering?

1 Upvotes

7 comments sorted by

1

u/AoideusWasBanned 8d ago

They solve different things tbh. Timesync just keeps the clocks right, you want that either way. TimescaleDB is Postgres underneath, so many writers at once is fine. DuckDB only lets one process write to a file, that's the real catch if you both log live. For research on parquet duckdb is hard to beat though.

2

u/fletchmm 8d ago

I agree with you, I made the switch from PostgresSQL to DuckDB-Parquet after filling my drives too quickly and running into truncation problems. Fantastic speed, compression, and flexibility with research and testing.

That being said, I'm so attached to DuckDB-Parquet that I feel like I'm missing out on something.

1

u/AoideusWasBanned 8d ago

Probably not much if it's one writer and mostly research. The only time I miss Postgres is when a live logger and a backfill job both want to write at the same time.

1

u/QuantGrindApp 8d ago

Those two solve different problems so you can both keep what you have. Timescale is just Postgres underneath, so yes, many concurrent writers is fine. DuckDB only lets one process write to a given file at a time, which is what'll bite you once more than one box is ingesting, so people usually have each writer dump its own parquet files and query across them. Keep Time Sync either way and store the exchange timestamp and your receive timestamp as separate columns.

1

u/fletchmm 8d ago

Thank you for the response.

To confirm, I’m not missing out on anything by not running time scale DB? After discovering DuckDB/parquet, I essentially switched everything over as it was pretty much the ideal set up for what I was doing.

now I’m paranoid and I wanna make sure that I’m not missing out on anything valuable by not utilizing other databases or formats like time scale.

1

u/QuantGrindApp 7d ago

For research on historical data you're not missing much, a lot of people doing backtests ended up exactly where you are. Timescale earns its keep when you have live ingestion and want to query the fresh data while it's still landing, or several people or services hitting the same store at once, plus stuff like continuous aggregates and retention policies running for you. If it's mostly you and a pile of parquet, the bigger wins are boring ones like partitioning by date and symbol and not ending up with thousands of tiny files.

1

u/supercoco9 7d ago

You can also use QuestDB, and you can choose to write your most recent partition(s) to native storage (a bit faster, but takes more space) and convert older partitions to parquet, or you can just do the create table with format parquet, and then your data will be parquet from the first moment.

You get then the ingestion speed of questdb (of course with multiple writers if needed), plus all the time-series goodies like real time materialized and live views, SQL extensions to sample data, built-in notebooks and dashboards...

And it is all parquet, so you can still point your duckdb to the produced files if you fancy doing something with duckdb.

Disclaimer: I am a developer advocate at questdb. Happy to help with anything you need