Here''s the thing. I''m designing an application that is very likely to generate lots of db entries quickly, therefore it''s important to think about scalability before doing any moves. To make it more clear: the model would be called ''Item'' and it will hold a serial number and some info about it. My guess is that the number of those items is going to grow up to, say, 100 000 in no time. And I need search and update through them fast enough. I''ve no experience doing that kind of thing, but the most obvious solution to me is to distribute entries over multiple tables, using hash, for example. So the question is: what would be the best way to this in theory, and how would that look in practice with ActiveRecord (how do I tell model to use a particular table dynamically?). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Nov-22 13:28 UTC
Re: distribution entries for model over multiple tables
On 22 Nov 2008, at 11:57, snitko wrote:> > Here''s the thing. I''m designing an application that is very likely to > generate lots of db entries quickly, therefore it''s important to think > about scalability before doing any moves. > > To make it more clear: the model would be called ''Item'' and it will > hold a serial number and some info about it. My guess is that the > number of those items is going to grow up to, say, 100 000 in no time. > And I need search and update through them fast enough. > > I''ve no experience doing that kind of thing, but the most obvious > solution to me is to distribute entries over multiple tables, using > hash, for example. So the question is: what would be the best way to > this in theory, and how would that look in practice with ActiveRecord > (how do I tell model to use a particular table dynamically?).If you really want to help the database, sharding over tables won''t help that much. You''d want to shard across multiple database servers. Fred> > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---