Usage of stored procedures

Hi,
I am trying my hands on RoR for a dummy project and I use Mysql as my
database. For data manipulation and querying purpose, should I write
ruby code directly in active record or write a stored procedure and
invoke a call through active record?
I understand there are many advantages of stored procedures:
1. They can help enforce data security.
2.Amount of information sent over the N/W is less
3. No compilation step is required to execute code
4. Once the procedure is present in the shared pool, retrival from
disk is not required everytime different users call the procedure i.e.
reduction in disk I/O

Many thanks,
Tyche

With ActiveRecord, you can made all SQL querie that you want with
several method of _sql or with a connection by driver. But it's not
needed. ActiveRecord made several method to avoid this SQL querie in
your Ruby Code.

So Avoid made SQL except for perform, but it's not advisor by default.

Hi Tyche,

We call stored procs when we have to query a particularly unfriendly
part of our database, but for the most part, we let ActiveRecord
handle creating all the SQL for us as Cyril said. Unless you have some
big, nasty ultra-normalized parts of your database, you shouldn't need
to write any SQL statements at all, just let your relationships in
ActiveRecord work their magic.

That being said, if in a particular instance, calling a stored proc is
going to save you lots of time, refer to this page
http://wiki.rubyonrails.org/rails/pages/StoredProceduresInMySql
but as a general rule I would recommend against it.

-Ryan