views:

25

answers:

1

All that I will do is insert records into the database. However, I would definitly like the database-independence that Ruby/ActiveRecord can offer me.

What would be the reccommended choice?

  1. Using simple insert queries, and rewriting them, and also maintaining my own database class for things as batch insertions;
  2. Using the power of ActiveRecord, but also having the overhead;
  3. Some other solution, mayhaps?

For the record, optimistically speaking I'll be doing an insertion per second/couple of seconds. I'll also (probably) be using ActiveRecord for reading from the database later on - but, in a different application.

+1  A: 

The main reason for writing your own queries would be to optimize performance if Active Record would prove too inefficient. But since one insert per second isn't really that much of a load, Active Record's performance will probably be more than enough for your needs.

Thus, I would definitely use Active Record in this situation -- there's no need to bother with your own database wrapper unless you really need to. Also, an extra bonus is that you can reuse the model definitions for reading data later on.

Pär Wieslander
One query/seccond is basically idle. Use AR.
thomasfedb