Hey folks, I have two different Rails apps and I would like t o sync the user databases. What''s the best way to do that? I thought of whenever someone registers with one app the user information is posted to the other app and vice versa. What would you use for that? JSON? Sinatra? Thanks for the help! -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
The main issues to consider are contention and scalability/performance. Can both apps be updated or just one? If both, what happens if both update the same field on the same record at the same time? If performance isn''t an issue, a simple synchronous js call to a RESTful API should be fine, waiting for a "success" response from the remote server. If you''re worried about scaling/performance, I''d consider a messaging architecture where each system passes messages to the other and the other listens to the queue. But of course if you do that, handling contentions becomes harder because you will have transactions that "worked" that conflict and will need to have some kind of eventual consistency resolution strategy. Just to ask the related question, what do people use for message queue''s in the Rails world (assuming they''re not on JRuby)? Best Wishes, Peter On Mar 30, 2011, at 10:10 AM, Heinz Strunk wrote:> Hey folks, > > I have two different Rails apps and I would like t o sync the user > databases. What''s the best way to do that? I thought of whenever someone > registers with one app the user information is posted to the other app > and vice versa. What would you use for that? JSON? Sinatra? > > Thanks for the help! > > -- > Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On Mar 30, 10:10 am, Heinz Strunk <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hey folks, > > I have two different Rails apps and I would like t o sync the user > databases. What''s the best way to do that? I thought of whenever someone > registers with one app the user information is posted to the other app > and vice versa. What would you use for that? JSON? Sinatra? > > Thanks for the help! > > -- > Posted viahttp://www.ruby-forum.com/.Are you talking about the whole database or just the users table? The way I read your post it looks like you just want to validate users and keep only one table for all users. If that is the case why not set up a connection in the application that does not own the users table that is only used by the User model? That should be enough to give you access to the user information you might need. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On 30/03/11 15:10, Heinz Strunk wrote:> I have two different Rails apps and I would like t o sync the user > databases. What''s the best way to do that? I thought of whenever someone > registers with one app the user information is posted to the other app > and vice versa. What would you use for that? JSON? Sinatra?Depending on where the databases are located have you considered simply adding a trigger at database level and updating the other database direct ? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.