News for hackers. Stuff that matters.
Re:New in PostgreSQL 10 by noncoml on Thursday September 21, 2017 @04:40PM (#15307145)
Designing for the future is a guaranteed project failure.

If one is starting a new project, hence contemplating what DB to use, starting with an ACID db is a safe bet in most cases(unless of course they are already starting with a huge amount of data).

By the time the outgrow the ACID database they will have a better idea of what exactly they need and more importantly they will have the resources to make the switch.

BTW: riak is hopefully not dead yet, let's see what bet365 can do with it..

Re:New in PostgreSQL 10 by wjossey on Thursday September 21, 2017 @04:52PM (#15307247)
I don't think we disagree, but I want to be cautious about saying "whatever we start with is always good enough."

I'm co-founder of a company, doing all of the technical work, and I too am using a very vanilla stack: Postgres, Elasticsearch, Redis, Memcache, Rails. However, having worked on massive scale-out projects before, I recognize where my pain points are going to be with my tech choices.

[1] I'm storing calendar data in postgres. This data is primarily key/value based, needs to be persistent, and on a per user basis potentially is tens of thousands of records. This is a medium term problem, and I'll likely move this data out of postgres and into a scale out solution sooner rather than later. I need relatively fast lookup times, but this is primarily a "high write, low read" scenario, that Cassandra is well suited for.

[2] I'm storing a bunch of text from blog posts, news articles, etc., in Postgres. I really dont' need the data to be in postgres, it's just a handy place to store it to synchronize with Algolia & Elasticsearch, where the true work happens. However, I dont' want to hold onto TBs & TBs of news articles in a postgres system. As that system scales out, it'll be unnecessarily expensive, as I don't need all the bells and whistles I'm getting from Postgres, for what is effectively a form of cold storage. This is a long term problem, and I likely won't tackle it for well over a year.

So, you're right, I'm not contemplating what DB to use, but I'm definitely aware of why I won't just leveraging the same database in perpetuity. Being focused on delivering customer value is vital, and that's my intent; however, scalability and cost structure do matter over the long term, so an understanding of where one will go is good as well.

Re:New in PostgreSQL 10 by simonw on Thursday September 21, 2017 @05:15PM (#15307411)
Have you considered Citus as your scale-out solution? https://www.citusdata.com - maybe you can have your PostgreSQL and eat it too.
Re:New in PostgreSQL 10 by wjossey on Thursday September 21, 2017 @06:15PM (#15307811)
Citus seems really cool (this is not a critique of the product), but probably not something I’d use. They seem to be very close in feature set to bigquery, and if I have to choose between the two bigquery wins for me. There are definitely situations where citus is a better solution, but I think the scenarios where I could need a scale out analytics platform, I’d choose BQ. Still, very supportive of what they are doing at Citus. It’s great.
Re:New in PostgreSQL 10 by manigandham on Thursday September 21, 2017 @07:55PM (#15308283)
MemSQL would be the on-premise alternative to BigQuery, RedShift, Snowflake and the others.

Citus is more focused on scalable OLTP rather than OLAP scenarios, giving you essentially an automatically sharding postgres database. Heap does use it for analytics but that's more so because of the JSON support and indexing in postgres itself.

Re:New in PostgreSQL 10 by wjossey on Thursday September 21, 2017 @10:04PM (#15308898)
I’m not sure I agree with this statement. BigQuery is not in memory, nor is redshift (not super familiar with snowflake). Whereas memsql is and would be prohibitively expensive to operate on datasets that are analytics based, because it is in memory based. It’s my understanding that citus is best suited to analytics workloads and parallel queries, and really isn’t comparable to memsql as it is attempting to provide scale out support with disk, which memsql doesn’t natively prefer.

Can you share some docs with me around how citus is more OLTP based? Looking to be educated.

Re:New in PostgreSQL 10 by manigandham on Thursday September 21, 2017 @10:47PM (#15309080)
MemSQL has in-memory rowstores and disk-based columnstores. Every columnstore table has a rowstore to aid in fast data ingest. Rowstores are meant for access of individual rows, lots of data updates, and smaller reference tables while columnstores are for the bulk of data requiring large scans and analysis. We have tables with 20 billion rows that take up < 10gb of memory.

BigQuery streaming ingest also uses in-memory buffering into BigTable until it's written to disk, just like Cassandra with memtables flushed into on-disk SSTables.

Citus is more manual work than MemSQL and doesnt support columnstores native, although you can use it with their cstore extension to get both. It's just a different design giving you a postgres database that automatically shards vs MemSQL's many optimizations around HA, replication, and very fast analytics performance.

Try the features page: http://www.memsql.com/features/

Re:New in PostgreSQL 10 by wjossey on Friday September 22, 2017 @10:38AM (#15312562)
Thanks for the education on MemSQL. I wasn’t aware of the analytics use case (had never come up in discussions I was a part of for that tech), so it was news to me.

This article had a nice overview. Somewhat outdated but mostly still up to date. https://lnkd.in/g4anCf5

I’ll say it seems precarious to me to mix and match row store in memory data with a columnar store. Is it never a performance issue to have these two systems potentially in contention with one another for resources?

Re:New in PostgreSQL 10 by manigandham on Friday September 22, 2017 @01:25PM (#15314054)
It's just data in memory. Rowstores are read from memory and columnstores are read from disk. The architecture uses leaf nodes and aggregator nodes so aggregrator memory is used for assembling the final results of a query.

Version 6 is even faster, you can try out the beta: http://www1.memsql.com/beta-6.3-features.html

Re:New in PostgreSQL 10 by ddorian43 on Friday September 22, 2017 @09:47AM (#15312098)
Every BigQuery query, actually loads all the data (for that query) in-memory until it finishes.
Re:New in PostgreSQL 10 by noncoml on Thursday September 21, 2017 @05:04PM (#15307331)
Agreed
Re:New in PostgreSQL 10 by threeseed on Thursday September 21, 2017 @06:03PM (#15307743)
> Designing for the future is a guaranteed project failure.

Based on what ? There is no evidence or logic behind this.

If you know that you are producing say 1GB a day of data that you must store then it is sensible and prudent to select a technology that can support your needs a year or two from now.

And this idea that you always have resources to make a switch later on is rarely the case. The more common scenario is that a team is established to implement something, it moves into production and then the team either disbands or moves onto something else. Why do you think so many people try and plan for the future ?

In most enterprise companies at least it would be considered a failure to have a project that in a year's time required another business case just to replace the database that the team should've appropriately selected in the first place.

Re:New in PostgreSQL 10 by noncoml on Thursday September 21, 2017 @06:50PM (#15308005)
Knowing that you will hit the limit of the database in X years is different.

Designing for the future is a horrible choice because where do you stop?

Eg. Why are you sure that Cassandra, or whatever you choose, will be good enough for the future? Maybe you will need a Spanner type database or something even more big/consistent/feature-full.

Re:New in PostgreSQL 10 by davedx on Friday September 22, 2017 @02:13AM (#15309780)
> Designing for the future is a guaranteed project failure.

Yes, I understand this. I would not want to get bogged down on infrastructure when trying to deliver early versions of a product. At the same time, I think database choice is one of the more important tech stack decisions you should make early on.

Cassandra also sounds like a good bet for the type of data I'm interested in storing (ML model inputs, so lots of key -> numerical value data). But my experience is mostly around RDBMS and some NoSQL. Hence the question. Thanks for the answer!

Re:New in PostgreSQL 10 by noncoml on Friday September 22, 2017 @04:31AM (#15310307)
> ML model inputs, so lots of key -> numerical value data

How big are the numerical value data? AFAIK Cassandra does like large amount of data per value. https://docs.datastax.com/en/cql/3.3/cql/cql_reference/refLi...

Also what do you expect the total amount of data to be?

BTW, I just recommended to start with PostgreSQL because it just works and will have your back no matter what ways you like to use retrieve you data.

However if you are absolutely sure you don’t require secondary indexes, joins, etc, and just need a KV database, Cassandra will work fine too.

Re:New in PostgreSQL 10 by Thaxll on Thursday September 21, 2017 @04:45PM (#15307183)
No it's not, say that have 2TB of logs daily, good luck designing that with a regular RDMS without sharding / clustering / re-balancing capabilities.
Re:New in PostgreSQL 10 by jacques_chester on Thursday September 21, 2017 @06:58PM (#15308038)
I expect either of Citus or Greenplum can deal with that kind of volume. Citus acts as an extension, Greenplum is descended from an earlier fork (now merging its back to mainline as part of overall development).

Citus specifically cite analytics and write throughput as their strengths. I believe them. They do seem to charge for shard rebalancing and some other features.

Greenplum comes with an inbuilt data science toolkit (MADlib) and has a long history of dealing with intensive workloads. I don't know if there is a commercial version with extra features. I don't think so, but I haven't looked closely.

Greenplum also gave birth to HAWQ, which uses the Greenplum distributed/parallel query planner to plan queries over Hadoop.

Disclosure: I work for Pivotal, we do most Greenplum development.

Re:New in PostgreSQL 10 by user5994461 on Friday September 22, 2017 @05:11AM (#15310448)
And citus will be a nightmare to setup and maintain, for what elasticsearch could have done easier and better out of the box. Use the right tool for the job.
Re:New in PostgreSQL 10 by jacques_chester on Friday September 22, 2017 @07:36AM (#15311176)
I was pointing out that 2TB/day is not a very high write volume for modern OSS RDBMSes, especially distributed ones.

As for elasticsearch, I have found it to be temperamental. The "out of the box" experience was usually unhappy. For logging I've seen people move to other tools (splunk, stackdriver) more than once.

Re:New in PostgreSQL 10 by user5994461 on Friday September 22, 2017 @11:58AM (#15313313)
I have found elasticsearch to be one the easiest database I ever had to setup and maintain. Some tuning to do when you have TB on multiple boxes but nothing hardcore.

2 TB/day is fairly easy... as long as you have a bit of experience AND one of the database that can scale horizontally AND the company buys the amount of hardware that is required.

StackDriver/Sumologic/logentries are cloud solutions, so obviously one doesn't have to deal with the database ever.

Re:New in PostgreSQL 10 by jacques_chester on Friday September 22, 2017 @07:27PM (#15316864)
I think it's anecdote vs anecdote, but clearly you have more experience. In a fulltext indexing situation I'd probably look at elasticsearch again; I don't deliberately hamstring myself to try and be right on HN.

On the other hand, if I have structured-enough data, I'm going to prefer relational tools for it. Hammers and algebraic nails and so on.

Re:New in PostgreSQL 10 by noncoml on Thursday September 21, 2017 @04:46PM (#15307195)
In which case they would not be designing for the future.

Did you miss this: "(unless of course they are already starting with a huge amount of data)"?