Hi, i am planning to build HA cluster for rails applications, using guideline http://www.slideshare.net/tim.lossen.de/how-to-build-a-stateoftheart-rails-cluster from Tim Loosen. Database replication should be easy with MySQL, I am currently using master-slave replication for backups, so configuring master-master wouldn''t be a big deal (as I hope). But I am wondering how to handle file uploads? First way which come into me mind was cross-exporting upload directories via NFS and slightly modifying file_column plugin. Another way is to store files in database, so MySQL replication will be used and than perform some way of caching (reading big files from database again and again doesn''t look like a good idea to me). Any ideas how to solve this? Regards Láďa --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Use Amazon S3. Then you are clustering DB but don''t need to cluster/replicate FS. It''s not a good idea to keep files in the DB as a rule. Of course, you _can_, but you''d have to really think through it. -Danimal On Apr 13, 2:16 am, durchanek <ladislav.durcha...-bgNlBvq18krou2LdaWhu0A@public.gmane.org> wrote:> Hi, > i am planning to build HA cluster for rails applications, using > guidelinehttp://www.slideshare.net/tim.lossen.de/how-to-build-a-stateoftheart-... > from Tim Loosen. > > Database replication should be easy with MySQL, I am currently using > master-slave replication for backups, so configuring master-master > wouldn''t be a big deal (as I hope). But I am wondering how to handle > file uploads? > First way which come into me mind was cross-exporting upload > directories via NFS and slightly modifying file_column plugin. > Another way is to store files in database, so MySQL replication will > be used and than perform some way of caching (reading big files from > database again and again doesn''t look like a good idea to me). > > Any ideas how to solve this? > > Regards > > Láďa--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Apr 13, 2008, at 1:16 AM, durchanek wrote:> > Hi, > i am planning to build HA cluster for rails applications, using > guideline http://www.slideshare.net/tim.lossen.de/how-to-build-a-stateoftheart-rails-cluster > from Tim Loosen. > > Database replication should be easy with MySQL, I am currently using > master-slave replication for backups, so configuring master-master > wouldn''t be a big deal (as I hope). But I am wondering how to handle > file uploads? > First way which come into me mind was cross-exporting upload > directories via NFS and slightly modifying file_column plugin. > Another way is to store files in database, so MySQL replication will > be used and than perform some way of caching (reading big files from > database again and again doesn''t look like a good idea to me). > > Any ideas how to solve this?Never *ever* store images in the database especially if you are doing replication or master master, sotring images in the db is very inefficient and will completely hose replication on the regular. NFS can work but has locking issues and is not POSIX compliant and is also fairly slow. If you have a SAN then you can use GFS from the red hat cluster suite to get a posix compliant clustered filesystem. Cheers- - Ezra Zygmuntowicz -- Founder & Software Architect -- ezra-NLltGlunAUd/unjJdyJNww@public.gmane.org -- EngineYard.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 -~----------~----~----~----~------~----~------~--~---
Thanks for replication explanation. GFS looks like a good way, but I think that it has two drawbacks: - introducing another single-point-of-failure - SAN requirement I would like to make this happen with two servers only + loadbalancer and pretty low-cost - applications are not heavy loaded, but failover would be a great feature. Is there eg. some way how to replicate directory via rsync/SSH/ whatever through daemon? There will be only a minimum file-upload operations, so having not-so-realtime replication of files would be sufficient. Cheers Láďa On 13 Dub, 20:50, Ezra Zygmuntowicz <ezmob...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Apr 13, 2008, at 1:16 AM, durchanek wrote: > > > > > > > Hi, > > i am planning to build HA cluster for rails applications, using > > guidelinehttp://www.slideshare.net/tim.lossen.de/how-to-build-a-stateoftheart-... > > from Tim Loosen. > > > Database replication should be easy with MySQL, I am currently using > > master-slave replication for backups, so configuring master-master > > wouldn''t be a big deal (as I hope). But I am wondering how to handle > > file uploads? > > First way which come into me mind was cross-exporting upload > > directories via NFS and slightly modifying file_column plugin. > > Another way is to store files in database, so MySQL replication will > > be used and than perform some way of caching (reading big files from > > database again and again doesn''t look like a good idea to me). > > > Any ideas how to solve this? > > Never *ever* store images in the database especially if you are doing > replication or master master, sotring images in the db is very > inefficient and will completely hose replication on the regular. > > NFS can work but has locking issues and is not POSIX compliant and is > also fairly slow. If you have a SAN then you can use GFS from the red > hat cluster suite to get a posix compliant clustered filesystem. > > Cheers- > - Ezra Zygmuntowicz > -- Founder & Software Architect > -- e...-NLltGlunAUd/unjJdyJNww@public.gmane.org > -- EngineYard.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 -~----------~----~----~----~------~----~------~--~---
On Mon, 2008-04-14 at 03:46 -0700, durchanek wrote:> Thanks for replication explanation. GFS looks like a good way, but I > think that it has two drawbacks: > - introducing another single-point-of-failure > - SAN requirement > > I would like to make this happen with two servers only + loadbalancer > and pretty low-cost - applications are not heavy loaded, but failover > would be a great feature. > Is there eg. some way how to replicate directory via rsync/SSH/ > whatever through daemon? There will be only a minimum file-upload > operations, so having not-so-realtime replication of files would be > sufficient.How about using something like: http://www.danga.com/mogilefs/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---