How to Store Data in App Platform

The following options are available to developers who need to store files and data in their App Platform app.

Managed Database

You can create a managed relational database from directly within App Platform for use in your app. For more details, see the Manage Database topic.

Spaces

DigitalOcean offers a product called Spaces, which is compatible with Amazon's S3 buckets. Spaces provide programmatic access to file storage at scale.

To use Spaces in your application, read the Spaces quickstart to create a Space, and then begin using the Space in your code via the RESTful API or existing AWS S3 tools.

Local Filesystem (Ephemeral Files Only)

If you are writing files for temporary use, you can use the local filesystem. However, keep these two things in mind:

  1. Instances are ephemeral, and are being continuously created and destroyed as the app is scaled, redeployed, etc, and any changes to the filesystem will be destroyed with the instance. This means that every redeployment of your app will reset the filesystem.

  2. If you have a multi-instance app from scaling horizontally, you should remember that each instance has a separate filesystem. Because of this, you should not use the local filesystem for anything that needs to be stateful.

Limits

Block storage volumes are not currently supported in App Platform. Block storage volumes are detachable network volumes that are mounted directly in the filesystem and extend the storage available to an instance. Because App Platform instances can be scaled and are ephemeral, more work needs to be done to ensure these mounts remain persistent and the data view that each instance sees is consistent.

Existing databases are instances of a DigitalOcean managed database created outside of App Platform for production use.
Create and configure a database in App Platform