F
F
Falsealarm2016-03-16 14:58:49
PostgreSQL
Falsealarm, 2016-03-16 14:58:49

What is the best way to connect to an external Postgresql database and archive records into the ruby ​​on rails application database?

There is a postgresql database where indicators from sensors are recorded. It is necessary to read data every 3 hours (about 200 thousand records) and accumulate them in the application database.
What I plan to do: create two models and use establish_connection to two different databases, create a rake task to copy active record objects received from an external database to the application database.
I suspect that this option is bad.
Tell me how best to implement?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Shakhunov, 2016-03-17
@inf

At least how to implement it will be good at least for what is implemented.
By crown, you can dump the base and pour the dump into another base.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question