Hello. I have large database of old web application (written in php). Want to rewrite in Rails. But here is a problem. My User data is split to 10 Table. named user_0, user_1,user_2 if user.id % 10 = 1 will store to user_1 for (database scable reason) But most people use rails is using 1 model => 1 table. Is anyone here know about how to implement or any plugin to do 1 model => multiple table or have similar experience ? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
xxdd wrote:> Hello. I have large database of old web application (written in php). > Want to rewrite in Rails. > > But here is a problem. > > My User data is split to 10 Table. named user_0, user_1,user_2 > if user.id % 10 = 1 will store to user_1 for (database scable reason) >What scaling issue is addressed by this remarkable approach? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
That certainly is unusual. If you don''t want to (or cannot) convert the ten user tables into a single users table, I would consider creating a pure ruby class that was composed with a user model. The pure ruby class would be a proxy and you''d delegate most of the method calls to the instance that you find by querying the ten ''sub-user'' tables. It''s possible that you could use this as a plan for migrating the data into one table, too. You could query from any table, but always save the data back to one. Eventually you''ll get all the active users over to one table. That''s probably more work than it''s worth but it''s an option. On May 17, 8:19 pm, James Byrne <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> xxdd wrote: > > Hello. I have large database of old web application (written in php). > > Want to rewrite in Rails. > > > But here is a problem. > > > My User data is split to 10 Table. named user_0, user_1,user_2 > > if user.id % 10 = 1 will store to user_1 for (database scable reason) > > What scaling issue is addressed by this remarkable approach? > -- > 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-/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 -~----------~----~----~----~------~----~------~--~---
James Byrne wrote:> xxdd wrote:>> My User data is split to 10 Table. named user_0, user_1,user_2 >> if user.id % 10 = 1 will store to user_1 for (database scable reason) > > What scaling issue is addressed by this remarkable approach?Allowing the database to ignore its own built-in block paging algorithms? I suspect the original coder invented that beauty. In PhP, natch... xxdd should read the /Rails Recipes/ chapter on legacy databases, then connect directly to that database. And she or he should then write and deploy new features in Rails while leaving the old system online. Don''t write Rails (or any app) for a long time without delivering anything. The best way to get your foot in the door is add one new feature with Rails, then give it to customers who can leave the old system online with the new one. -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---