Storage
Understanding storage options is key to architecting your applications on Molnett. Currently, Molnett supports ephemeral disk storage for your containers. Object Storage and other persistent solutions are planned.
Ephemeral Disks (Current Offering)
Molnett provides two types of ephemeral disk storage for your containers. It is crucial to understand that both types are ephemeral and will not persist data if a service instance (pod) is terminated or replaced.
1. Container Filesystem
Each container instance in your Molnett service has its own isolated, writable filesystem layer.
- Strictly Ephemeral: This filesystem is tied directly to the life of the individual container. Any data written here (that is not part of a mounted service volume) will be permanently lost if that specific container stops, restarts, or the service instance it belongs to is terminated.
- Use Cases: Best used for temporary scratch space needed by a single process within a container, or for the application code and binaries that are part of the Docker image itself.
- Best Practice: Avoid storing any data here that needs to persist even for the lifetime of the service instance. Use Service Volumes for that, or external storage for true persistence.
2. Service Volumes (volumes in molnett.yaml)
Molnett allows you to define volumes at the service level in your molnett.yaml. These volumes can then be mounted into one or more containers within that specific service instance using volume_mounts.
name: my-service-with-volumes
containers:
- name: app-container
image: my-app-image
volume_mounts:
- volume_name: shared-data
path: /app/data # Mounts the 'shared-data' volume at /app/data
- name: sidecar-container
image: my-sidecar-image
volume_mounts:
- volume_name: shared-data # The same volume can be mounted in multiple containers
path: /sidecar/data
volumes:
- name: shared-data
# This defines a volume named 'shared-data' for the service instance.
# It behaves like an emptyDir in Kubernetes.
- Behavior (Like Kubernetes
emptyDir): Service Volumes in Molnett behave likeemptyDirvolumes in Kubernetes. A fresh, empty directory is created when a service instance (pod) is scheduled, and this directory is mounted into the specified containers. - Shared Within a Service Instance: These volumes facilitate data sharing between containers running within the same service instance (pod). For example, one container can write data, and another container in the same pod can read it.
- Instance-Ephemeral Lifetime: The data in these Service Volumes exists only for the lifetime of that specific service instance (pod). If the pod is terminated for any reason (e.g., node failure, scaling down, deployment update replacing the pod, or the pod crashes), the data in its Service Volumes is permanently lost. A new pod will get a new, empty volume.
- Use Cases:
- Sharing configuration files, sockets, or temporary data between containers within a single pod.
- Providing a common scratch space for multi-container processing that doesn't need to persist beyond the pod's life.
- Temporary storage that needs to survive individual container restarts if the pod itself remains running (though this is less common, as container restarts often imply pod recreation).
Important: Do not use Service Volumes for data that needs to persist beyond the lifecycle of a single service instance. For such needs, await Molnett's upcoming persistent storage solutions or use an external database/storage service.
Object Storage (Soon Available)
Molnett is actively developing an Object Storage solution designed for durable, scalable storage of files and data blobs. This service will be ideal for:
- Storing user-generated content (images, videos, documents).
- Website and application asset hosting.
- Backup and archival.
- Data lakes and analytics.
Details on how to provision, manage, and access Object Storage via molnctl and from your applications will be provided once the service is launched.
Future: Other Storage Solutions
While Molnett currently focuses on ephemeral instance storage and Object Storage, we are continuously evaluating the needs of our users.
- Managed Databases: Support for managed databases (e.g., PostgreSQL) is a planned future enhancement to simplify stateful application development.
For applications requiring other forms of persistent storage today (e.g., block storage for databases if not using an external DB service), you should utilize external cloud provider services or self-managed solutions.
We are committed to expanding Molnett's stateful capabilities to provide a more comprehensive platform for all your application needs.