Database integrity and multiple users?

7 views
Skip to first unread message

xsc...@gmail.com

unread,
Oct 15, 2012, 5:44:56 AM10/15/12
to rubyonra...@googlegroups.com
Does RAILS ensure that multiple users of a RAILS application won't create a corrupt database 
if each user is creating database entries with foreign keys linking multiple tables together?

Do you have to use explicit table locking ?

Thanks,

P.

Frederick Cheung

unread,
Oct 15, 2012, 1:43:30 PM10/15/12
to Ruby on Rails: Talk
Rails doesn't do anything by default. You can use optimistic or
pessimistic locking of rows if you need to guard against concurrent
modifications to a single row. I've never needed table level locking
(which is an obvious scalability bottleneck)
I personally always use foreign key constraints to enforce integrity
of those references

Fred

> Thanks,
>
> P.
Reply all
Reply to author
Forward
0 new messages