News for hackers. Stuff that matters.
Re:Beringei: A high-performance time series storage engine by cocoflunchy on Saturday February 04, 2017 @03:03AM (#13566168)
What would HN suggest to store about 1GB of data per day, mostly for archiving and offline analysis, with less than 10 columns including timestamp? We're currently writing everything to our postgres DB and flushing the table to S3 every few days but it's killing the app performance under high loads. I'm looking for something that is easy to set up and keep running with low to no maintenance.
Re:Beringei: A high-performance time series storage engine by pdq on Saturday February 04, 2017 @03:13AM (#13566195)
CSV

Same way most web servers log traffic.

Re:Beringei: A high-performance time series storage engine by IanCal on Saturday February 04, 2017 @07:20AM (#13566725)
Strongly recommend this. Your disks are not going to struggle with 1G/day, it's easy to setup & manage, easy to move data around and easy to process later. Worst case is it's quick to try and see if it suits.
Re:Beringei: A high-performance time series storage engine by ju-st on Saturday February 04, 2017 @04:43AM (#13566401)
Considering the use case ("archiving and offline analysis") this is likely the best choice. If you need some buzzwords or want to get fancy, try HDFS
Re:Beringei: A high-performance time series storage engine by Mahn on Saturday February 04, 2017 @10:23AM (#13567225)
Or perhaps SQLite, since it should perform similar to writing to a CSV file and you get querying out of the box afterwards.
Re:Beringei: A high-performance time series storage engine by saosebastiao on Saturday February 04, 2017 @01:31PM (#13568209)
SQLite is a major powerhouse for stuff like this, and if your analysis is on a single computer with a single disk, analysis is almost always faster than any sort of highly parallel big data setup. I've loaded, analyzed, and reported on 2TB of data using SQLite in less time than it took for an 8 machine spark cluster took to load the data.
Re:Beringei: A high-performance time series storage engine by storyinmemo on Saturday February 04, 2017 @04:11AM (#13566330)
Can you elaborate on what it is that slows down your app performance? Is it bottle-necking on writing to the database? Does the database have read activity? Does the application slow down when there is read activity?

With some basic assumptions on my part including that you can have a delay in writing data to the database (since it's archival and analysis), but you don't want the application to be delayed, putting a fast queue like Kafka or RabbitMQ in place could help. It'll buffer when the database is under load, isolating your application from that.

Offline analysis might also skip the database entirely: columnar data formats (parquet) or log structured merge / sorted string tables (rocksdb) could work very well for archival or offline analysis in MR type environments.

Re:Beringei: A high-performance time series storage engine by cocoflunchy on Saturday February 04, 2017 @12:30PM (#13567875)
Yes, we only have one DB for everything and it is bottle-necking on writes. Queuing the writes is probably the easiest solution since we already have RabbitMQ setup... thanks for your answer.
Re:Beringei: A high-performance time series storage engine by saosebastiao on Saturday February 04, 2017 @01:27PM (#13568185)
There are a lot of good suggestions here, but if this is the route you're going down and you are still using the same database, do everything you can to batch your inserts. In your queue consumer, aggregate as much as you can tolerate in memory, and then insert them all and commit the inserts in a single transaction. This eliminates a huge amount of MVCC overhead.
Re:Beringei: A high-performance time series storage engine by zo1 on Saturday February 04, 2017 @12:39PM (#13567915)
Don't write it to your main transactional database, then.

Have a separate connection to a DB on another machine that is handling the load. Do that within the transaction/request from the client, or pop it into a message queue.

The queue will "persist" the data, but will also schedule it for when your other box/DB can ingest it. At the end of the day, if you're pushing too-much data, you need to have a mechanism in place to let you scale. To me, a simple solution would be a message queue server with plenty of redundant storage space. From there on, you keep adding more consumers.

Re:Beringei: A high-performance time series storage engine by GordonS on Saturday February 04, 2017 @12:46PM (#13567959)
If the message queue becomes a bottleneck, buffering/batching can also help - instead of sending individual messages to the queue, send them in batches (based on the number, time period, or both).
Re:Beringei: A high-performance time series storage engine by mirekrusin on Saturday February 04, 2017 @09:05AM (#13566996)
If you don't have strong guarantees on that table (usually with high volume comes less requirements, ie. you can loose few rows here and there and it's not the end of the world) then you may want to try unlogged table (new versions of postgres do support it). Also make sure you're using BRIN index (if any) on that timestamp column.
Re:Beringei: A high-performance time series storage engine by tyingq on Saturday February 04, 2017 @10:47AM (#13567327)
I think the answer depends on what tool you're using for offline analysis. Reducing the number of intermediate copies and formats would be desirable, right? Start with that, and then find some asynchronous way (to avoid blocking your app) and dump the data straight to that format.
Re:Beringei: A high-performance time series storage engine by jeffrand on Saturday February 04, 2017 @08:16AM (#13566861)
We used InfluxDB along with a few other tools. Check out: https://www.influxdata.com/time-series-platform/
Re:Beringei: A high-performance time series storage engine by rodionos on Thursday February 09, 2017 @05:12AM (#13605864)
Try Axibase Time Series Database. We support SQL which should work well for analytics use cases.

SQL docs: https://github.com/axibase/atsd-docs/tree/master/api/sql

Analytics examples: https://github.com/axibase/atsd-use-cases

Re:Beringei: A high-performance time series storage engine by user5994461 on Saturday February 04, 2017 @11:12AM (#13567440)
Given the "archive and offline analysis" requirements, which are special characteristics.

The "hacked" way is to go CSV files, store them on s3. It is very limited but it is also very simple. (Not sure what software can run queries on CSV files directly).

The "doing things right" way is to go for AWS RedShift or Google BigQuery. There is a learning curve at the start but it's really REALLY good and it will pay off by many folds later.

Re:Beringei: A high-performance time series storage engine by patrec on Saturday February 04, 2017 @04:28PM (#13569177)
sqlite can directly process csv
Re:Beringei: A high-performance time series storage engine by weego on Saturday February 04, 2017 @03:09AM (#13566183)
If you want low to no maintenance and maintain some of what you have I'd suggest pushing it into kinesis instead of postgres and then dumping to s3 as you're already doing.
Re:Beringei: A high-performance time series storage engine by cocoflunchy on Sunday February 05, 2017 @08:10AM (#13572243)
Kinesis looks pretty good but it's yet another (proprietary) product to integrate and maintain... I'd rather avoid that if I can for now, we're a very small team and the fewer tools we have to use the better.
Re:Beringei: A high-performance time series storage engine by throwaway2016a on Saturday February 04, 2017 @11:38AM (#13567579)
Second this. This use case is exactly what Kinesis was built for in the first place.

Additionally, Dynamodb can be decent for this as long as you only need to sort on time.

Re:Beringei: A high-performance time series storage engine by gaius on Saturday February 04, 2017 @06:27AM (#13566620)
What would HN suggest to store about 1GB of data per day,

1Gb per day is not a lot - that's 12k/sec which is trivial. Your Postgres must be badly misconfigured!

Re:Beringei: A high-performance time series storage engine by agacera on Saturday February 04, 2017 @11:14AM (#13567457)
If you are already invested in aws I suggest you to use the firehose + s3 to store data and use the Athena to query it.
Re:Beringei: A high-performance time series storage engine by jdwyah on Saturday February 04, 2017 @06:27AM (#13566619)
Kinesis firehose to S3 and then query with Athena is pretty great. I've been very happy with the combo.
Re:Beringei: A high-performance time series storage engine by kvz on Saturday February 04, 2017 @03:08AM (#13566180)
One idea might be to write to S3 directly and use Athena for your offline analysis
Re:Beringei: A high-performance time series storage engine by cocoflunchy on Sunday February 05, 2017 @08:03AM (#13572219)
Thanks for Athena, I hadn't heard about it!
Re:Beringei: A high-performance time series storage engine by robochat on Saturday February 04, 2017 @04:18AM (#13566347)
You could try influxdb.
Re:Beringei: A high-performance time series storage engine by vegabook on Sunday February 05, 2017 @08:18AM (#13572275)
teafiles