Alibaba Cloud - Cloud Database Management and Data Migration

  • About the author: A cloud computing network operation and maintenance personnel, sharing the technology and dry goods of network and operation and maintenance every day. 

  •  Motto: Keep your head down and hurry on your way, be respectful

  • Personal homepage: Homepage of Netdou

Table of contents

Table of contents

1. Introduction and usage scenarios of cloud database

1. Introduction to Cloud Database

2. Features of cloud database

3. Introduction to Alibaba Cloud RDS

4. ApsaraDB for MYSQL

5. Comparison between cloud database and self-built database

6. Cloud database function

7. Diversified data storage

8. Remote data disaster recovery

9. Big data analysis scenarios

2. Basic concepts of ApsaraDB for MySQL

1. ApsaraDB for MySQL version products

 2. Instance, database. account

3. Internal and external network address

4. Access Mode

5. Whitelist

3. Create instance, database and account

1. Quick management process of cloud database

 2. Cloud database instance creation steps

4. SQL operation and data import and export

1. Connect to cloud database

2. Advantages of DMS

5. Database migration to the cloud

1. What is database migration

2. MySQL Migration Tool

Mysqldump

PhpMyAdmin

3. Data Transfer Service DTS

4. Conditions for database cloud migration

6. Common settings for cloud database operation and maintenance

1. Change configuration

 2. Setting parameters

 3. Migrate availability zone

 4. Switch the active and standby instances

 5. Data replication method


Table of contents

  1. Introduction and usage scenarios of cloud database
  2. Basic Concepts of Cloud Database
  3. Create instance, database and account
  4. Data import and export and SQL operations
  5. Database Migration to the Cloud
  6. Common settings for cloud database operation and maintenance
  7. experiment

1. Introduction and usage scenarios of cloud database

1. Introduction to Cloud Database

Built on a cloud computing platform, cloud database overcomes the limitations of traditional database engines and is a pay-per-use, stable, reliable, and elastically scalable online database service. There is no need to purchase software and hardware, and there is no need for dedicated staff to maintain the IT infrastructure.

Cloud databases allow you to easily set up, operate and scale databases in the cloud. It provides cost-effective resizable capacity while managing time-consuming database administration tasks, freeing you to focus on your applications and business.


2. Features of cloud database

  1. Pay according to storage capacity and computing power requirements
  2. cloud portability
  3. Scale on demand
  4. High Availability (HA)


3. Introduction to Alibaba Cloud RDS

Relational Database Service (RDS) is a stable, reliable, and elastically scalable online database service. Based on the Feitian distributed system and full SSD high-performance storage , it supports MySQL, SQL Server, PostgreSQL and MariaDB Tx engines, and provides a complete set of solutions for disaster recovery, backup, recovery, monitoring, migration, etc., to help you solve database operation and maintenance troubles.


4. ApsaraDB for MYSQL

The MySQL version of Alibaba Cloud Database is based on Alibaba's MySQL source code branch, and has achieved high concurrency during Double 11. The test of large data volume.

  1. Has excellent performance and throughput
  2. Advanced functions such as optimized reading and writing, data compression, and intelligent tuning.

MySQL is the world's most popular open source database.

As an important part of the open source software combination LAMP (Linux+Apache+MySQL+Perl/PHP/Python), it is widely used in various applications .

In the era of Web 2.0, the community forum software system Discuz and the blog platform Wordpress of Fengfu all over the network are based on MySQL to implement the underlying architecture.

In the Web 3.0 era, large Internet companies such as Alibaba, Facebook, and Google have used the more flexible MySQL to build mature large-scale database clusters.


5. Comparison between cloud database and self-built database


6. Cloud database function

safety

Before security:

Allow connection instance IP whitelist

control access source

Support VPC


In security:

support SSL

Eliminate man-in-the-middle attacks

Supports Transparent Data Encryption (TDE)

Automatic encryption of data on disk


After security:

RDS supports the SQL audit function to record access sources


Availability:

Active and standby architecture:

Two instances are on different servers

Automatically sync data

When the primary instance fails, automatically switch to the standby instance


Intra-city disaster recovery:

Deploy active and standby instances in different availability zones

independent power

Network environment improves data reliability


Remote disaster recovery:

Users can back up in different places and switch to the master instance to ensure business availability


Scalability:

Elastic expansion, 100% resource utilization

Instance memory and disk space can be upgraded on demand

Each read-only instance has a separate connection address

Pressure distribution controlled by the application


Ease of use:

Simultaneous connection between internal and external networks for easy management

Automatic backup for two years and data recovery to solve more than 90% of system failures

Automatic monitoring and early warning, regular performance inspection


7. Diversified data storage

RDS can be used with storage products such as ApsaraDB for Memcache, ApsaraDB for Redis, and object storage OSS. Diversified storage expansion is really needed.


8. Remote data disaster recovery

Users can use the DTS data transmission service to synchronize the database in the self-built computer room to the RDS instance in any region on the Alibaba Cloud database in real time.


9. Big data analysis scenarios

Big Data Computing Service (MaxCompute, formerly known as ODPS) provides solutions for massive data warehouses and analysis and modeling services for big data.

Through the data integration service, RDS data can be imported into MaxCompute to realize large-scale data calculation.


2. Basic concepts of ApsaraDB for MySQL

1. ApsaraDB for MySQL version products

 

 2. Instance, database. account

Example:

  1. A database service process that independently occupies physical memory
  2. Users can set different memory sizes, disk space and database types, and the specifications of the internal instance memory will determine the performance of the instance
  3. After the instance is created, the configuration can be changed and the instance can be deleted.

database

  1. Logical unit created under an instance
  2. One instance can create multiple databases, MySQL type instance can have 500 accounts with normal authority, and the number of databases created by account with high authority is not limited
  3. The database is uniquely named within the instance

account

  1. Each database account can be used for multiple databases
  2. Read and write permissions for each database can also be assigned to multiple database accounts
  3. An instance can create multiple common accounts, the specific number is related to the instance core
  4. Only one high-privilege account can be created in an instance

3. Internal and external network address

Use the inner and outer addresses separately:

The system provides the intranet address by default, and you can modify the connection address directly.

It is applicable when the application department is on the ECS in the same region as your RDS instance and the network type of the RDS instance is the same as that of the ECS.


Use the external network address alone:

It is applicable when the application is deployed on an ECS in a different dungeon from your RDS.

It is applicable when the application is installed on a system other than the Internet.


Use the internal and external network addresses at the same time:

It is applicable when the modules in the application deployment are deployed on the ECS in the same region and the same network type as your RDS instance and on the ECS in a different region or network type from your RDS instance.

Applicable to the modules in the application deployment that are deployed in the same region as your RDS instance and the network type

When running on the same type of ECS and on a system other than Ahliyun.


4. Access Mode

standard mode

  1. The cloud database uses load balancing to shield the impact of database engine HA switching on the application layer and shorten the response time
  2. However, it will slightly increase the probability of connection disconnection and lose the ability to intercept SQL
  3. This mode only supports one connection address. If the instance has both an internal network address and an external network address, you must first
  4. Switch to standard mode only after the internal network address or external network address is released.

high security mode

  1. It has the ability to prevent 90% connection flash disconnection and SQL interception (based on SQL semantic analysis to realize defense against SQL injection attacks)
  2. But it will increase the response time by more than 20%
  3. This mode supports the coexistence of internal and external network addresses.

5. Whitelist

  1. For the security and stability of the database, add the IP addresses or IP segments that need to access the database to the whitelist.
  2. Before enabling the target instance, you need to modify the whitelist first.
  3. Each instance of MySQL can add up to 50 whitelist groups, and each whitelist group can add up to 1000 IP addresses or IP segments.
  4. The whitelist function supports setting IP addresses or IP segments.
  5. % or 0.0.0.0/0 is to allow any IP access. This setting will greatly reduce database security

3. Create instance, database and account

1. Quick management process of cloud database

 2. Cloud database instance creation steps


4. SQL operation and data import and export

1. Connect to cloud database

MySQL client

Enter the data instance link address, port (default 3306), database user name and database password in the connection input box, and click OK

mysql command line

Command format: mysql-u user_name-h, example.mysql.alibabalabs.com –P3306-pxoox, where u specifies the user name, h specifies the host name, -P specifies the port, and -p specifies the password

DMS access (Aliyun)

Data Management supports MySQL, SQL Server, PostgreSQL, MongoDB, Redis and other relational databases and NoSQL database management, and also supports Linux server management.


2. Advantages of DMS

  1. Easily own data analysis capabilities
  2. Greatly improve R&D efficiency
  3. Optimize database performance in real time
  4. Comprehensive access security protection
  5. Rich data source support

5. Database migration to the cloud

1. What is database migration

 The purpose of database migration to the cloud is to facilitate and quickly realize data migration between various database sources, and to realize the following business scenarios, etc.:

  1. Migrating an offline self-built database to cloud database RDS
  2. Migrating self-built databases on the cloud to cloud database RDS
  3. Cross-instance RDS database migration within Alibaba Cloud
  4. Migrate from other public cloud databases to Alibaba Cloud RDS

Database migration to the cloud needs to support migration between heterogeneous database sources

Perfect database migration also needs to support multiple ETL features such as library list three-level mapping and data filtering.


2. MySQL Migration Tool

>Use traditional database migration tool data to cloud database RDS

> Migrate data to cloud database RDS through Data Transfer Service (DTS)

Mysqldump

It is mainly used to dump the stored data of the MySQL database. It basically produces a SQL script that contains the commands CREATE TABLE INSERT etc. necessary to recreate the database from scratch.

PhpMyAdmin

PhpMyAdmin is a MySQL database management tool built on the website host in a Web-Base manner, allowing administrators to manage MySQL databases with a Web interface. Use its synchronization function to migrate MySQL database, which can realize the synchronization of a single data table or the entire database.


3. Data Transfer Service DTS

Data Transmission Service (Data Transmission Service) DTS supports data transmission between relational databases, NoSQL, big data (OLAP) and other data sources. It is a data transmission service that integrates data migration, data subscription and real-time data synchronization.

  1. data migration
  2. data subscription
  3. data synchronization
  4. Perfect monitoring system

 DTS Three Migration Modes

 


4. Conditions for database cloud migration

Create an RDS database

During data migration, if the database to be migrated does not exist in the target RDS instance, DTS will automatically create it

In the following two cases, the database needs to be created manually

  1. ·The database name does not conform to the RDS definition specification
  2. ·The database to be migrated has a different name in the source MySQL instance than in the target RDS instance

Create a migration account

  1. Provide the migration accounts of the source instance and the target RDS instance
  2. If you do not have the above accounts, you need to create them separately
  3. Database permissions to meet the specific needs of various storage engines

migration steps


6. Common settings for cloud database operation and maintenance

1. Change configuration

If the current instance configuration cannot meet the performance requirements of the application, or the current instance configuration is too high, you can change the instance configuration.

While the changed configuration is in effect, the service may experience a flash disconnection within 30 seconds.

 2. Setting parameters

RDS allows users to customize some instance parameters

The method of setting cloud database parameters is basically similar to that of local database parameters.

After some parameters are modified, the instance needs to be restarted

 3. Migrate availability zone

RDS instances support the choice of single availability zone and multiple availability zones, and instances with multiple availability zones can withstand higher levels of disasters.

Migrating an instance to an availability zone is the process of copying instance data to a new availability zone, so it is an instance-level migration. After migrating an availability zone, all attributes and configurations of the instance will not change.

 4. Switch the active and standby instances

The hot standby architecture is adopted, and the service can be switched in seconds after a physical server fails. The entire switching process is transparent to the application.

There may be intermittent interruptions during the switchover of the active and standby instances, requiring the application to have a reconnection mechanism.

 5. Data replication method

Users can choose different data replication methods according to their own business characteristics to improve the availability of cloud databases.

 


  Creation is not easy, please pay attention, like, collect, thank you~ 

Guess you like

Origin blog.csdn.net/yj11290301/article/details/131713298