Stefan Magnus Landrø
2007-Nov-28 13:44 UTC
Replacing the database in Active Record with RPC-based interface
Hi there, We''re about to move our persistent store from a MySQL database to an RPC-based data store. However, we really like programming against the AR-api, and would like to keep as much as possible from, so that we can keep stuff like callbacks, validations, relations etc. How would you do it? Does it make sense to replace the mysql-adapter with and RPC-based adapter, translating SQL statements into equivalent rpc calls? And the convert the result-set into whatever AR uses in its conversion into objects? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rick Olson
2007-Nov-28 15:27 UTC
Re: Replacing the database in Active Record with RPC-based interface
On 11/28/07, Stefan Magnus Landrø <stefan.landro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi there, > > We''re about to move our persistent store from a MySQL database to an > RPC-based data store. > > However, we really like programming against the AR-api, and would like > to keep as much as possible from, so that we can keep stuff like > callbacks, validations, relations etc. > > How would you do it? > > Does it make sense to replace the mysql-adapter with and RPC-based > adapter, translating SQL statements into equivalent rpc calls? And the > convert the result-set into whatever AR uses in its conversion into > objects?It''s probably easiest to create your own model class from scratch that mimics the same API. I started working on porting more abstract model concepts (observers, validators, callbacks, etc) to a very experimental ActiveModel project so this job should be easier in the future. But, Rails 2.0 has taken priority. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---