vendredi 3 juillet 2015

Better way of analyzing data in DB from Rails?

I have a server running collecting some data, and this was written in Rails. It has a sql-lite db stored on disk. The Rails part is built as a json-RESTful api which talks to iPads, and data were collected there.

Now I need to analyze the data in some tables from the sql-lite db. Let's say I'd like to do some computation on the stored data, for instance the prices my customers pay, and run some fancy algorithms on it.

Then I need to show the results of the computation back in the RESTful api so that on the iPad I could know the results.

I'm thinking of doing this via:

  1. Use Python/Matlab or whatever to read the sql-lite db
  2. Do computation there and then insert it back to the sql-lite db in a separate table
  3. Create a new endpoint for Rails to render the new results

I'm wondering is this a good way to do? Can I directly interact with the database created by Rails? If not what would be a better way in this scenario?

Aucun commentaire:

Enregistrer un commentaire