PVC (Persistent Volume Claims)
PandaStack PVC (Persistent Volume Claims) Documentation
What are PVCs?
PVC (Persistent Volume Claims) are storage resources that provide persistent data storage for your applications. Unlike temporary container storage that gets deleted when containers restart, PVCs ensure your data persists across deployments, scaling events, and container restarts.
How PVCs Work
Data Persistence: PVCs create dedicated storage volumes that remain intact even when your application containers are destroyed or recreated during deployments or scaling operations.
Shared Storage: Multiple container instances can access the same PVC, enabling shared file systems and data synchronization across scaled applications.
Automatic Mounting: PVCs are automatically mounted to your containers at specified mount points, making them accessible to your application code.
Backup and Recovery: PVC data is included in PandaStack's backup systems, providing data protection and recovery capabilities.
Available Storage Options
Based on the PandaStack interface, you can configure PVCs with the following storage sizes:
0.5 GB - Suitable for small configuration files, logs, or cache data
1 GB - Good for small databases, user uploads, or session storage
2 GB - Ideal for medium-sized applications with moderate data needs
3 GB - Perfect for larger applications with substantial data requirements
5 GB - Suitable for data-heavy applications or file storage systems
Custom sizes - Available for enterprise requirements
Common Use Cases
File Uploads and User Content
Maintain user-uploaded files, images, and documents.
yaml
Application Logs
Store application logs for debugging and monitoring.
yaml
Cache and Session Data
Maintain cache files and session data for better performance.
yaml
How to Use PVCs in Your Application
Step 1: Configure PVC in PandaStack Dashboard
Navigate to your service configuration
Scroll to the "PVC Disk" section
Select your desired storage size from the dropdown
The system will automatically provision the persistent volume
Step 2: Access PVC Data in Your Code
Once configured, your PVC is automatically mounted to your container. Here's how to use it in different programming languages:
Python Example
python
Node.js Example
javascript
Step 3: Handle Data in Auto-Scaling Scenarios
When your application auto-scales, all instances share the same PVC. Consider these best practices:
File Locking for Concurrent Access
python
Instance-Specific Data Organization
python
Best Practices
Data Organization
Structure your persistent data logically with clear folder hierarchies:
Backup Strategy
While PandaStack handles infrastructure backups, implement application-level data export:
python
Performance Considerations
Use PVCs for data that truly needs persistence
Consider caching frequently accessed data in memory
Implement proper error handling for disk I/O operations
Monitor storage usage to avoid running out of space
Security
Never store sensitive data in plain text
Implement proper file permissions
Use encryption for sensitive persistent data
Regularly rotate and update stored credentials
Monitoring and Troubleshooting
Check Storage Usage
bash
Monitor File System Operations
python
Pricing
PVC storage is included in your PandaStack plan limits. Additional storage beyond plan limits incurs standard storage fees as outlined in your PandaStack pricing tier.
Last updated