Hi All, I want to give each of my user some 20k of space to load their images or pic. for their avatar. These images will not be sent over the internet. So is it good to store it in db (I am using mysql) or just in images directory. Uploading is not a problem as it will be done as a one time job directly to the server. I will have plenty of users. With the limited knowledge of rails and web I have, I find storing it as a file in images directory and storing the name of the file in DB very easy to achieve. Please help me with the pros and cons of this approach. Thanks & Warm Regards, -- 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.
Your instincts on this one are generally correct. There are some use cases where storing images in the DB would be useful (e.g. access restriction, manipulation at the time of the request), but for 98% of all applications, storing images in public/images will reduce the load on the database and your application server. On Tue, Feb 22, 2011 at 2:13 PM, Bhasker Harihara < harihara.bhasker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All, > > I want to give each of my user some 20k of space to load their images or > pic. for their avatar. > > These images will not be sent over the internet. > > So is it good to store it in db (I am using mysql) or just in images > directory. Uploading is not a problem as it will be done as a one time job > directly to the server. > > I will have plenty of users. > > With the limited knowledge of rails and web I have, I find storing it as a > file in images directory and storing the name of the file in DB very easy to > achieve. Please help me with the pros and cons of this approach. > > Thanks & Warm Regards, > > -- > 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. >-- 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.
Given the size of files I would store them on the server or on another server like Amazon S3 storage. B. On Tue, Feb 22, 2011 at 7:35 AM, Chris Kottom <chris-kMviOf/NVQxZWXO/OqhO/A@public.gmane.org> wrote:> Your instincts on this one are generally correct. There are some use cases > where storing images in the DB would be useful (e.g. access restriction, > manipulation at the time of the request), but for 98% of all applications, > storing images in public/images will reduce the load on the database and > your application server. > > On Tue, Feb 22, 2011 at 2:13 PM, Bhasker Harihara > <harihara.bhasker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> Hi All, >> >> I want to give each of my user some 20k of space to load their images or >> pic. for their avatar. >> >> These images will not be sent over the internet. >> >> So is it good to store it in db (I am using mysql) or just in images >> directory. Uploading is not a problem as it will be done as a one time job >> directly to the server. >> >> I will have plenty of users. >> >> With the limited knowledge of rails and web I have, I find storing it as a >> file in images directory and storing the name of the file in DB very easy to >> achieve. Please help me with the pros and cons of this approach. >> >> Thanks & Warm Regards, >> >> -- >> 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. > > -- > 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. >-- 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.