News for hackers. Stuff that matters.
Re:Scaling out relational data models, and SQL, through co-l... by raarts on Saturday December 24, 2016 @02:10AM (#13248967)
I do not get why giving each customer his own database would be so costly. Each postgresql instance can handle many smaller databases. Are shared buffers allocated per database?
Re:Scaling out relational data models, and SQL, through co-l... by ahachete on Saturday December 24, 2016 @06:56AM (#13249472)
First of all, every database comes with some metadata overhead (catalog tables) which amounts to ~ 30MB. Take into account that this also may (should!) be in memory (shared_buffers) so it can become expensive.

But the most significant factor is whether you need to do queries that span multiple users/tenants. If you need to, you will require postgres_fdw and nor performance neither manageability will be good at all.

Re:Scaling out relational data models, and SQL, through co-l... by paulddraper on Sunday December 25, 2016 @01:51PM (#13255015)
> need to do queries that span multiple users/tenants

If you need that, shouldn't you use one database?

Re:Scaling out relational data models, and SQL, through co-l... by raarts on Saturday December 24, 2016 @04:02PM (#13251608)
If you use it for multi tenanting then probably you won't need that.

But 30MB is a lot yes.

Re:Scaling out relational data models, and SQL, through co-l... by ddorian43 on Saturday December 24, 2016 @02:16AM (#13248982)
Yeah, kinda(not shared buffers but something else). Each table/index has overhead.

Question: Do you know of ANY db that you can do 1 db/customer ?(for 1 million customers) Just like I thought, no.

Re:Scaling out relational data models, and SQL, through co-l... by unsoundInput on Saturday December 24, 2016 @03:01AM (#13249048)
This obviously depends on the workload / amount of data per customer, but for some use-cases this could be done with SQLite.

EDIT: Well, looks like someone beat me to it

Re:Scaling out relational data models, and SQL, through co-l... by andy_ppp on Saturday December 24, 2016 @03:17AM (#13249076)
I assume he wants a proper database and to be honest if you have zero interaction between the things you are partitioning on it's very easy to scale with SQLite or any other database.

There's no reason you can't either run more servers or multiple instances of postgres per server, with docker or otherwise.

I'm probably going to try using Citus Data instead of moving to Cassandra if I ever get big. We'll see.

Re:Scaling out relational data models, and SQL, through co-l... by unsoundInput on Saturday December 24, 2016 @07:47AM (#13249594)
I honestly don't see why you wouldn't consider SQLite to be a "proper database." I think it has a reasonably competitive feature set.

In a usecase where you consider independent databases, with few interactions between them, for millions of users (and a few MBs + binary blobs of data per user) I'd certainly consider it as a possible solution.

Re:Scaling out relational data models, and SQL, through co-l... by ddorian43 on Saturday December 24, 2016 @06:34AM (#13249419)
Cassandra is completely different beast. Like, it has no feature of postgresql and vice-versa.
Re:Scaling out relational data models, and SQL, through co-l... by brianwawok on Saturday December 24, 2016 @01:05PM (#13250865)
They both have selects and inserts
Re:Scaling out relational data models, and SQL, through co-l... by andy_ppp on Saturday December 24, 2016 @03:00AM (#13249042)
SQLite ;-)
Re:Scaling out relational data models, and SQL, through co-l... by ddorian43 on Saturday December 24, 2016 @06:32AM (#13249411)
Actordb does it in a distributed way.
Re:Scaling out relational data models, and SQL, through co-l... by raarts on Saturday December 24, 2016 @04:55PM (#13251796)
Hey that's an interesting link. Thank you for that.