Is there any support for multiple databases in Rails 3? Either natively through ActiveRecord or third party gem? Thanks. -- 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.
trung wrote:> Is there any support for multiple databases in Rails 3? Either > natively through ActiveRecord or third party gem?I haven''t looked at Rails 3 yet but since being able to access multiple databases is a core feature of Rails 1 and Rails 2 I feel confident in saying that if Rails 3 didn''t have it then it would be a regression and therefore very unlikely. :-) Bob -- 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.
If you mean can rails connect to different db''s like mysql, oracle, etc, then the answer is yes, but my guess is that you are asking if there is support to connect your app to different schema''s. I''d like to know this too. My app has a master database, and then each customer has their own schema that contains their specific data. We had to jump through some hoops to make it work in rails so hopefully there is something in rails 3 to make life easier. I haven''t been able to find any info on this so I''m guessing there isn''t anything coming. On Jul 9, 8:12 pm, trung <tr...-S1GuQQ7/EclBDgjK7y7TUQ@public.gmane.org> wrote:> Is there any support for multiple databases in Rails 3? Either > natively through ActiveRecord or third party gem? > > Thanks.-- 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 guessed right. I want to connect to multiple schemas. Like you said, we had to jump through hoops to get Rails 2 to work with multiple databases, especially with the schema migrations between multiple databases. I see that there''s a project called DBCharmer that solves all these problems for Rails 2. I wish we had known about it before. Unfortunately, DBCharmer doesn''t work with Rails 3. It would be awesome of Rails 3 addresses all the problems associated with using multiple databases out of the box. On Jul 11, 5:49 am, jmamma <jackli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If you mean can rails connect to different db''s like mysql, oracle, > etc, then > the answer is yes, but my guess is that you are > asking if there is support to connect your app to different schema''s. > > I''d like to know this too. My app has a master database, and then > each > customer has their own schema that contains their specific data. > We had to jump through some hoops to make it work in rails so > hopefully > there is something in rails 3 to make life easier. I haven''t been > able to > find any info on this so I''m guessing there isn''t anything coming. > > On Jul 9, 8:12 pm, trung <tr...-S1GuQQ7/EclBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > Is there any support for multiple databases in Rails 3? Either > > natively through ActiveRecord or third party gem? > > > Thanks.-- 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.
jmamma wrote:> If you mean can rails connect to different db''s like mysql, oracle, > etc, then > the answer is yes, but my guess is that you are > asking if there is support to connect your app to different schema''s. > > I''d like to know this too. My app has a master database, and then > each > customer has their own schema that contains their specific data.That''s a bad idea. Generally speaking, all data should be in the same schema.> We had to jump through some hoops to make it work in railsThis is another example of Rails making bad things hard. Don''t do bad things! Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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.
I don''t think this is a bad idea at all. People just have different need. For example, if you''re building an eCommerce site. You might want to clone the Catalog database that holds all static products information and deploy it on each front end app server. But all the app servers share a centralized Order database. This is just one example, there are many other use cases for multiple databases... Just because it''s hard to do, doesn''t mean it''s a bad idea... On Jul 14, 7:01 am, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> jmamma wrote: > > If you mean can rails connect to different db''s like mysql, oracle, > > etc, then > > the answer is yes, but my guess is that you are > > asking if there is support to connect your app to different schema''s. > > > I''d like to know this too. My app has a masterdatabase, and then > > each > > customer has their own schema that contains their specific data. > > That''s a bad idea. Generally speaking, all data should be in the same > schema. > > > We had to jump through some hoops to make it work in rails > > This is another example of Rails making bad things hard. Don''t do bad > things! > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://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.
trung wrote:> I don''t think this is a bad idea at all. People just have different > need.A database per customer is bad.> > For example, if you''re building an eCommerce site. > > You might want to clone the Catalog database that holds all static > products information and deploy it on each front end app server. But > all the app servers share a centralized Order database.Then you need clustering and replication support in the DB, not in Rails.> > This is just one example, there are many other use cases for multiple > databases... > > Just because it''s hard to do, doesn''t mean it''s a bad idea...-- 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.
It obviously depends on your needs. We are connecting to multiple databases simply because we have to pull information from different systems. We have a main database where most Rails related data lives but we are also connecting to a second system which belongs to our PACS image storage system to pull information from it. Haven''t tried out Rails 3 yet with multiple connections, initial tests showed some problems with it, but I will definitely come back to it and it is critical for us to get it working. Migrations were no issue for us since we were only reading from the PACS system. Daniel On Jul 14, 8:26 pm, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> trung wrote: > > I don''t think this is a bad idea at all. People just have different > > need. > > A database per customer is bad. > > > > > For example, if you''re building an eCommerce site. > > > You might want to clone the Catalog database that holds all static > > products information and deploy it on each front end app server. But > > all the app servers share a centralized Order database. > > Then you need clustering and replication support in the DB, not in > Rails. > > > > > This is just one example, there are many other use cases for multiple > > databases... > > > Just because it''s hard to do, doesn''t mean it''s a bad idea... > > -- > Posted viahttp://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.