fBetter practice for huge size of table on Ruby on Rails 4 / ActiveRecord
How could I partition a big table in the postgreSQL with Active Record on Rails 4
I prefer PostgreSQL or other RDBMS, because I tried it in MongoDB. It is really slow on it.
Is Rails 4 supporting good solution for a one whole big table ?
(my case: more than
50 billionsof records, size is about20TB)
There are a User table containing name, personal_data, year fields.
The data can be divided by year and the data will be divided evenly.
I think it is not practical to create multiple model like User_1950, User_2001,..., User_2015
I want to partition whole data by year
There are two approached I can think of
physical table in the same database. (sharding ?)physical database on the different databases. (could it works well with Rails)I want the solution can compatible with Active Record
it will act like
User.find(name: xxx, year: 1988)
User.find(name: xxx, year: 2012)
So that I don't care about how to access the partitioned multiple tables.

I found a gem partitioned but which is not supporting Rails 4
Since you are storing the data by years, maybe you can use sharded data based on years. I would suggest octopus for use with activerecord.
Your queries will become something like:
User.using(:year_2012).find(name: xxx)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With