Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shared file storage for a Rails Application

I have a rails app that accepts file uploads and I wanted to know the best way to have common storage between servers. Since we have a number of windows applications we have used samba in the past, but as we build pure linux apps I would like to do this the best possible way.

We are expecting large amounts of data, so would need to scale this across multiple file servers.

like image 942
csexton Avatar asked Nov 29 '08 19:11

csexton


People also ask

Where are rails files stored?

By default in the development environment, Active Storage stores all uploaded images on your local disk in the storage subdirectory of the Rails application directory. That's the file you uploaded!

How do I add active storage in rails?

After creating a new application (or upgrading your application to Rails 5.2), run bin/rails active_storage:install to generate a migration that creates these tables. Use bin/rails db:migrate to run the migration. active_storage_attachments is a polymorphic join table that stores your model's class name.

How does active storage work in rails?

Active Storage uses two tables in your application's database named active_storage_blobs and active_storage_attachments . After creating a new application (or upgrading your application to Rails 5.2), run rails active_storage:install to generate a migration that creates these tables.


2 Answers

I've used paperclip with an S3 backend.

like image 66
Mike Breen Avatar answered Sep 30 '22 10:09

Mike Breen


If you want to have all the data in-house than a networked file-system might be the way to go. Try setting up AFS it scales pretty good.

like image 45
Honza Avatar answered Sep 30 '22 09:09

Honza