Deploy SQL and NoSQL databases, configure object storage simulation, implement automated backup strategies with cron, test data restoration, and design a complete Disaster Recovery Plan for ABC Retail — all locally in VirtualBox.
A complete cloud data platform requires multiple types of storage, each optimized for different use cases. ABC Retail needs structured data storage (relational database), unstructured data storage (object storage for images and files), key-value caching, and a robust backup and disaster recovery strategy. You will implement each component and document how they work together.
A database schema is the blueprint that defines the structure of all tables, columns, data types, and relationships. A well-designed schema is critical — poor database design causes performance problems, data inconsistencies, and security vulnerabilities that are very difficult to fix after data is in production.
image_url column pointing to MinIO demonstrates the cloud pattern of storing binary files in object storage while keeping references in the relational database.-e flag allows you to pass SQL commands directly from the shell without entering interactive mode. This is useful for automation scripts that need to query databases. You should see a list of all 4 tables and the column definitions of the customers table. Take a screenshot — this is a documentation deliverable.MinIO is an open-source object storage server that is 100% compatible with the Amazon S3 API. This means code written for MinIO works with AWS S3 without modification — it's the perfect local simulator. Object storage is used to store unstructured data like images, videos, documents, and backups.
server /data --console-address ":9001" telling MinIO to store data in /data and run the web console on port 9001. The console allows you to create buckets and upload files through a graphical interface — just like the AWS S3 console.http://[VM-IP]:9001
minioadmin
MinioPass@2024
abc-retail-products
mc alias set command stores the connection details (URL + credentials) under the alias "local". The mc cp command uploads a file to the bucket at the specified path. The path images/product-001.txt creates a "virtual folder" structure — object storage doesn't actually have folders, but the key (path) can contain slashes that tools display as folder hierarchies.Redis is an in-memory key-value database used for caching frequently accessed data. Instead of querying MariaDB (which reads from disk) for every page load, the application checks Redis first. Cache hits are 100x faster than database queries. Redis is the cloud equivalent of services like AWS ElastiCache or Azure Cache for Redis.
--appendonly yes flag enables AOF (Append-Only File) persistence — without this, all cached data would be lost if Redis restarts. While cache data is by definition ephemeral, for session storage (user login tokens), persistence ensures users aren't logged out unexpectedly when Redis restarts.SET key value EX seconds stores a value with automatic expiration (TTL). GET key retrieves the value. TTL key returns seconds until the key expires (-1 means no expiry, -2 means the key doesn't exist). KEYS * lists all keys (use with caution in production — on a large Redis instance this can be slow). The key naming convention product:1:price uses colons as namespace separators — a standard Redis convention that keeps key names organized and prevents collisions between different types of data.Backups are the last line of defense against data loss. In cloud environments, managed database services perform automated backups — but you must configure them and regularly test restores. This step builds an automated backup system from scratch, teaching you how managed cloud backup services actually work behind the scenes.
set -euo pipefail ensures the script exits immediately if any command fails (preventing silent failures). mysqldump --single-transaction creates a consistent snapshot without locking tables (critical for production databases serving live traffic). gzip compresses the SQL dump — database backups can be 10x smaller when compressed. The retention policy (delete backups older than 7 days) implements cloud storage lifecycle management. The logging function records every action with timestamps — essential for auditing backup success/failure.-lh flags on ls show file details in human-readable format including the backup file size.minute hour day-of-month month day-of-week. 0 2 * * * means "at minute 0 of hour 2, every day, every month, every weekday" — so every day at 2:00 AM. The >> appends script output to the log file. The 2>&1 redirects error output (stderr) to the same file as normal output (stdout) — so errors are captured in the log. Save and exit nano to activate the cron job.crontab -l command lists all currently scheduled cron jobs for the root user. You should see the backup entry you just added. In cloud environments, scheduled tasks like this are handled by services like AWS EventBridge Scheduler, Azure Logic Apps, or Google Cloud Scheduler — but they all work on the same cron time expression syntax.A backup you have never restored is not a backup — it's a hope. Regularly testing restore procedures is mandatory in any professional environment. This step simulates a database disaster and proves you can recover.
gunzip -c to decompress the backup file and pipe it directly to mysql. The -c flag decompresses to stdout (the terminal) rather than creating a file — which feeds directly into mysql via the pipe. This avoids creating a large uncompressed SQL file just to restore. The mysql command reads the SQL statements from stdin and executes them, recreating all tables and data.A Disaster Recovery Plan (DRP) is a documented process for restoring operations after a catastrophic failure. Every enterprise company has one. Without a tested DRP, an outage turns into a chaotic emergency where everyone argues about what to do while the system is down.
"ABC Retail – Disaster Recovery Plan v1.0"SHOW TABLES + DESCRIBE customerscrontab -l shows the entry)mc commands work with a simple URL change to target real AWS S3. Every cloud provider offers object storage because it is the most cost-effective and scalable way to store unstructured data.