-1

I've been reading RethinkDB documentation but I'm confused about how to design properly a database for perfomance.

I need to store much data for date but there's no any relation between data in different dates. I need a table for each date linked with many tables (very frequently upserted).

It's better to create a table for each date in the same database or directly create a different database for each date?

Nuno André
  • 4,739
  • 1
  • 33
  • 46

1 Answers1

1

Databases in RethinkDB merely group tables together into something similar to a namespace. Which database a table is in doesn't impact performance at all, only how you access the table.

So whether to put everything into one database or split it up into multiple databases is mostly just a matter of taste in the end.

Additionally there are a few operations that you can apply (more easily) to all tables in a given database. For example you can run something like r.db("db name").reconfigure({replicas: 3, shards: 2}) to shard all tables in the db name database over two shards, and to replicate their data three times. So you can use databases as a mean to configure groups of tables rather than each table individually.

Daniel Mewes
  • 1,876
  • 14
  • 16
  • Thanks! Great answer. I wasn't able to find this in the documentation. Info about how to optimize the data model for writing is confusing. – Nuno André Mar 07 '16 at 13:14