Kinsta Application Hosting customers have another option for persistent data storage now that they can add virtual disk space to their projects.

This persistent storage complements the ability to connect applications to persistent content in databases and third-party file stores. As the name implies, the data saved to persistent storage lives on across builds and deployments of the applications themselves.

This kind of storage could be essential to applications that accumulate disk-stored data as they run.

By way of example, Evelin Szabados, Tech Lead for the team of developers behind Kinsta’s Application Hosting platform, says: “Imagine a sale tax calculating function that creates data maintained and shared within an application, or a machine learning application with large datasets that need to be stored and accessed by multiple processes simultaneously.”

Persistent Storage and Containerized Applications

Szabados says that an ephemeral existence for both code and data is the default behavior for applications in a containerized environment like that used at Kinsta.

“One of the key attributes of containerized application deployments is that the containers created during deployments get destroyed and re-created on each subsequent deployment,” she says. “This means data generated by the application also get destroyed.”

Szabados says Kinsta uses the container orchestration platform Kubernetes, which offers persistent volumes (PVs) as an alternative to ephemeral storage.

“PVs can be attached to the application’s pods — the smallest deployable units in Kubernetes,” she says. “Pods are basically equal to the processes defined by Application Hosting customers.”

Persistent storage can be associated with two of the three process types available to applications at Kinsta: the web service and the background worker.

As Szabados explains: “Each process represents a pod, and each can have its own persistent storage.”

Adding Persistent Storage to Your Application

Application Hosting customers manage persistent storage through the same MyKinsta dashboard used to create, edit, and monitor applications.

When creating a new application within MyKinsta, the Resources tab now includes a Disk option for web service and background worker processes. (Disks are not available for the cron job process type.)

An application will have just one web service process, but you can create multiple background worker processes and optionally add disk space to any of them.

Each “disk” represents a Kubernetes persistent volume.

Within the Resources tab, Click on Disk to expand its dialog:

Screenshot: The location of the 'Disks' dialog within MyKinsta.
Locating the Disks dialog for persistent storage while adding an application.

Within the Disk dialog, you can specify a mount path for your new disk:

Screenshot: Adding a mount path for a disk within MyKinsta.
Specifying a mount path when adding a disk for persistent storage.

You can choose a mount path that suits your application’s configuration, except for the following:

  • /etc/
  • /var/
  • /lib/
  • /usr/local/
  • /mnt/
  • /app/
  • /workspace/
  • /layers/
  • /root/
  • /

After entering the mount path, select the storage space your app requires:

Screenshot: Choosing the size of a disk within MyKinsta.
Selecting from disk-size options when adding persistent storage.

Note: You can increase the size of a disk at any time, but you can’t reduce its size. (To deploy the same project with less disk space, create a new application with your preferred specifications.)

Editing Your Application’s Disk Settings

To change storage settings, navigate to Applications to find your application in MyKinsta and click Disks in the left-hand menu. Now click the pencil icon under Actions:

Screenshot: Locating the pencil icon to start editing storage option.
Selecting a process to edit its persistent storage settings.

Below, we are changing the disk’s mount path (formerly /var/lib/data) to /var/lib/content:

Screenshot: Changing a persistent disk's mount path.
An example of changing the mount path for existing persistent storage.

After clicking the Finish editing button, we can use the Kinsta Web Terminal to confirm that the change to the mount path happens immediately:

Screenshot: Accessing persistent storage via the command line on its mount path.
Using Web Terminal to access and view the mounted persistent storage volume.

We’ll Keep Your Persistent Data Safe

Kinsta generates daily backups for persistent data, keeping each backup for 7 days. Our Support team can restore a backup on request.

Remember that restoring a backup will overwrite content currently in persistent storage. And deleting the application itself will eliminate all of its backups.

Deploy Your Application With Persistent Storage Today

Do you have an idea for an application that could use persistent storage? Here’s how you can get up to speed quickly with Kinsta’s Application Hosting platform:

  1. Browse our growing library of quick-start examples to see how to deploy your favorite technologies from Git hosts like GitHub, GitLab, and Bitbucket.
  2. Review our official Persistent Storage documentation.
  3. Create your MyKinsta account and start building risk-free!

When you deploy, your code and its persistent storage services will run on the Google Cloud Platform’s top-tier infrastructure, backed by the platform’s C2 virtual machines.

That’s a powerful home for your application and its data.