TipsCloud TipsObject Storage

Using File and Object Storage

Flightcontrol’s Web Server and Worker build types use Elastic Container Service (ECS) to run your applications. Each Flightcontrol service runs in a container as an ECS task. These tasks are ephemeral, which means that the local disk storage is not saved between restarts or new deploys.

This is a good thing, because it means that you can scale your application horizontally to new instances without having to worry about sharing data stored on the local file system between instances. However, it also means that you need to use a different storage mechanism for your application’s data.

Generally speaking, you can use one of three approaches to share data with this type of architecture:

  • Use a database service like Amazon RDS or MongoDB Atlas
  • Use a shared file system like Amazon Elastic File System (EFS)
  • Use an object storage service like Amazon S3

Flightcontrol does not support configuring a shared file system on your containers directly, but you can use object storage to achieve a similar result.

Object Storage

Object storage is a type of storage that stores data as files or objects in a bucket. Each object has a unique key, and can have its own metadata. Typically, object storage gets used to store multimedia data, such as images, videos, PDF documents, or other files.

For example, if you setup and install a content management system to run your company’s blog, you could use object storage to store the images for each blog post. If you stored the images on the local file system, the images would be erased if you re-deployed the application, or wouldn’t be accessible from another instance of the content management system server.

With an Amazon Web Services approach, you can use Simple Storage Service (S3) buckets to store your objects in buckets. You can create a bucket for each application, or you can create a single bucket and use folders to organize your objects. Each bucket can have a security policy associated with it to control access to the objects in the bucket.

Using Object Storage with your Application

To use object storage, you would need to configure your application to use S3 or another object storage service. Flightcontrol does not yet provide any configuration help for object storage, but if you are on a paid support plan, we can help get you set up. You can also provision your own S3 buckets and policies on your AWS account yourself, and then use those buckets with your application.

You can also configure CloudFront to serve your objects from S3, which can help improve performance, and also use your custom domain.

If you are using a content management system, you can usually find plugins to help you integrate with S3. For example, if you are using WordPress, you can use the WP Offload Media Lite plugin to store your media files in S3.

Many web application frameworks also support using object storage - for instance, Rails has the ActiveStorage library, and PHP has the Flysystem library, which you can configure with File Storage for Laravel.