MariaDB is a popular open-source relational database management system (RDBMS) that is a fork of MySQL. It is designed for scalability, high performance, and robust data security. MariaDB supports a wide range of storage engines and features SQL compliance, making it suitable for modern application development.
Key Features of MariaDB
- High Performance: Optimized for speed and scalability.
- Open Source: Free to use and customize.
- Cross-Platform: Compatible with various operating systems and cloud platforms.
- Compatibility: Seamless migration from MySQL.
- Scalability: Suitable for small projects to large-scale enterprise applications.
Steps to Deploy MariaDB on Akash
1. Prepare Your Environment
Ensure you have:
- Akash CLI installed and configured.
- A funded wallet with AKT tokens for deploying your workload.
- A domain or IP to access your MariaDB instance, if required.
2. Create the SDL (Service Definition Language) File
The SDL defines your MariaDB deployment’s resource requirements, container image, and other configurations.
Here’s a sample SDL file for deploying MariaDB on Akash:
---version: "2.0"
services: mariadb: image: mariadb:10.6 env: - MYSQL_ROOT_PASSWORD=yourpassword - MYSQL_DATABASE=mydatabase - MYSQL_USER=myuser - MYSQL_PASSWORD=mypassword expose: - port: 3306 as: 3306 to: - global
profiles: compute: mariadb: resources: cpu: units: 1 memory: size: 512Mi storage: size: 5Gi
placement: global: pricing: mariadb: denom: uakt amount: 100
deployment: mariadb: mariadb: profile: mariadb count: 1
3. Customize the SDL
- Replace
yourpassword
,mydatabase
,myuser
, andmypassword
with your desired credentials. - Adjust the
resources
(CPU, memory, and storage) based on your workload requirements. - Set
amount
in thepricing
section according to your budget.
4. Deploy to Akash
-
Submit the SDL file to Akash:
Terminal window akash tx deployment create deploy.yaml --from <your-wallet-name> --node <node-address> --chain-id <chain-id> -
Wait for deployment approval. Once approved, note the lease ID.
-
Access the logs to verify MariaDB is running:
Terminal window akash provider lease-logs --node <node-address> --chain-id <chain-id> --dseq <deployment-sequence> --gseq <group-sequence> --oseq <order-sequence> -
Retrieve the public IP/endpoint of the deployment for connecting to the database:
Terminal window akash provider lease-status --node <node-address> --chain-id <chain-id> --dseq <deployment-sequence>
5. Connect to MariaDB
Use a MariaDB client or your application to connect to the database instance. The connection string will look like:
mysql -u myuser -p -h <akash-ip-address> -P 3306
Best Practices
- Security: Use strong passwords and configure firewall rules to restrict database access.
- Backup: Regularly back up your database to ensure data durability.
- Scaling: Monitor resource usage and scale up resources in the SDL as needed.
This guide provides a streamlined process for deploying MariaDB on Akash. With the SDL template, you can easily adapt the configuration for your specific needs.