The default filesystem for services running on Render is ephemeral. Application data isn’t persisted across deploys and restarts, and this works just fine for most apps because they use managed databases to persist data.
But many applications need persistent disk storage that isn’t ephemeral. These include:
- Infrastructure components like Elasticsearch, Kafka and RabbitMQ.
- Databases like Redis, MySQL and MongoDB.
- Blogging platforms and CMSs like WordPress, Ghost and Strapi.
- Collaboration apps like Mattermost, GitLab and Discourse.
This is where Render Disks come in. Render services can use disks to store data that persists across deploys and restarts, making it easy to deploy stateful applications while benefiting from Render features like instant setup, fully-managed SSL, private networking and auto deploys from Git.
Render Disks are backed by high performance SSDs and protected against data loss through automatic daily snapshots.
Using disks is quick and easy. You can add a disk to a new service by clicking on Advanced during service creation and adding a name, absolute mount path and the desired size for your disk.
You can also add a disk to an existing app by going to the Disks tab for your service, and picking a name, mount path and size.
A new deploy will be triggered once you click Save, and your disk will be available as soon as the deploy is live.
You can view disk usage over time and increase disk size on the Disks tab for your service.
No system is completely safe from data loss or corruption, which is why Render automatically creates snapshots for your disks once every 24 hours, and retains each snapshot for at least 7 days.
- Adding a disk to a service prevents zero downtime deploys. A new deploy first stops your app to prevent it from writing to disk, and only then brings up the new version so the app can start writing to the disk again. This typically only takes a few seconds, but your application will be unavailable during this time. However, this is needed to prevent data corruption that can happen when different versions of an app read and write to the disk at the same time.
- You can increase the allocated size for your disk at any time, but you can’t decrease it after creation. Increasing the size will trigger a new deploy, which will create a few seconds of downtime for your app.
- Services with disks can only have a single instance for now. We plan to remove this limitation in the future to enable multiple service instances each with its own own disk. Combined with Render’s built-in private networking, this will let you deploy clusters for stateful applications like MongoDB and Elasticsearch.