HOW TO SETUP UDB MYSQL AS YOUR BACKEND DATABASE FOR UHOST
November 1, 2023
Choosing MySQL as your database in a cloud environment offers several advantages, making it a popular choice for many cloud-based applications and services. To store your application records & data in a MySQL database, SCloud offers UDB MySQL which can be integrated with UHost. Before we jump into the steps for setting up UDB MySQL in SCloud console, here are some reasons to consider MySQL for cloud-based database solutions:
- 1. Open Source and Cost-Effective
MySQL is open-source software, which means you can use it without incurring licensing fees. This can lead to cost savings, especially in cloud environments where you pay for resources based on usage.
- 2. Widely Supported
MySQL is one of the most widely supported relational database management systems (RDBMS). It is compatible with numerous programming languages and platforms, making it easy to integrate into various cloud-based applications.
- 3. Scalability
MySQL can be scaled horizontally and vertically to handle increased workloads. Many cloud providers offer tools and services for easy database scaling, ensuring your application can grow with your user base.
- 4. High Availability
Cloud platforms provide options for high availability and data redundancy. You can configure MySQL to work in master-slave or multi-node setups to ensure data integrity and minimal downtime.
- 5. Data Security
MySQL provides robust data security features, including authentication, authorization, encryption, and auditing, to protect your data in the cloud.
- 6. Performance
MySQL is known for its high performance and efficient query execution. It can handle complex transactions and queries, making it suitable for a wide range of applications.
- 7. Community and Support
MySQL has a large and active community, which means you can find plenty of online resources, forums, and documentation to troubleshoot issues and seek help. Additionally, commercial support options are available from various providers.
- 8. Replication and Clustering
MySQL supports replication and clustering for load balancing and fault tolerance. Cloud environments make it easier to set up and manage these features.
- 9. Compatibility with Cloud Services
Many cloud providers offer managed MySQL database services (e.g., Amazon RDS, Azure Database for MySQL, Google Cloud SQL) that simplify database administration, backup, and scaling.
- 10. Integration with Cloud Ecosystem
MySQL can be integrated with other cloud services, such as serverless functions, storage solutions, and monitoring tools, enhancing the capabilities of your cloud-based application.
- 11. Flexibility
MySQL allows you to choose storage engines that best suit your application’s requirements. InnoDB is commonly used for transactional applications, while MyISAM is suitable for read-heavy workloads.
- 12. Data Backups and Recovery
Cloud platforms often include built-in backup and recovery solutions, making it easier to protect and restore your MySQL databases.
- 13. Global Reach
Cloud providers offer data centers in various regions, allowing you to deploy MySQL databases closer to your users, reducing latency and improving performance.
Here’s how to use SCloud Console to setup UDB MySQL:
- 1. Spin Up UHost Compute Instance (if not already done so):
- 1.1. Select the UHost Configuration
- a. Region & Availability Zones
-
- b. Configure & select model configuration (UHost Type, CPU Platform, CPU Number of Cores, Memory)
-
- c. Configure & select your OS
-
- d. Configure your disk settings (Disk Type, Size)
-
- e. Configure your login settings for the UHost (password for root, login through Key Pair)
-
- f. Optional: You can configure more settings (UHost Name, bootstrap script etc. when the UHost initialized)
- 2. Set Up UDB MySQL:
- 2.1. Go to ‘All Products’ and click on ‘MySQL UDB’.
- 2.2. Create Database.
- 2.3. Select your region, we will provision the region similar to our UHost in order to have a private connectivity.
- 2.4. Configure your Database specs (We will keep it minimum but in case of production work load you have to go with HA option in order to achieve high availability).
- 2.5. Select the same VPC which your UHost instance is spun on. Then, enter a database name and the password for the root user which will be used.
- 2.6. Choose your payment option and click ‘Purchase Now’. Your UDB MySQL database is now set up!
- 3. Connect to your UDB MySQL:
- 3.1. Login to your UHost via ssh ubuntu@UHost_ip
- 3.2. Enter the commands below to install MySQL client:
- a. sudo apt update && sudo apt upgrade
-
- b. sudo apt install mariadb-client-core-10.6
- 3.3. Now you can connect to your database through mysql -h udb_ip -u root -p & login via password.
- 3.4. You are now connected to your database as shown:
- 3.5. You can now start to create database and insert whatever records you want to store them in it as follows:
It’s important to note that the specific choice of database system depends on your application’s requirements, architecture, and your team’s familiarity with the technology. While MySQL offers numerous benefits for cloud-based applications, it’s essential to evaluate your project’s unique needs and consider alternatives like PostgreSQL, MongoDB, or cloud-native databases if they better align with your use case.
For any enquiries, please email enquiry@scloud.sg.