aws 数据库迁移

    科技2025-02-16  16

    aws 数据库迁移

    The Agenda of this blog is to understand the different aspects of Data Migration. This blog will also try to illustrate a basic question “Why move your legacy database(s).. ?”

    该博客的议程旨在了解数据迁移的不同方面。 该博客还将尝试说明一个基本问题“为什么要移动旧数据库。?”

    There are many questions about making the transition to move a legacy Databases(s) to the Amazon Web Services (AWS) cloud, and this blog can help you with the decision and the journey to migrate. So, yes, you can move legacy apps to the cloud, but let’s delve in to what that means.

    关于将旧数据库迁移到Amazon Web Services(AWS)云的过渡,存在很多问题,该博客可以帮助您做出决定和迁移过程。 因此,是的,您可以将旧版应用程序移动到云中,但是让我们深入研究这意味着什么。

    数据库焦虑 (Database Anxiety)

    Databases in AWS are colossal, and Amazon Aurora, Amazon, Redshift, Amazon RDS, Amazon DynamoDB and Amazon ElasticCache can be used by your application. Before moving to these Amazon Managed services, there is a sort of database anxiety or concerns as to how our application will behave after cloud migration. But Amazon provides flexible ways to move your native on premises database(s) to AWS databases.

    AWS中的数据库非常庞大,您的应用程序可以使用Amazon Aurora,Amazon,Redshift,Amazon RDS,Amazon DynamoDB和Amazon ElasticCache。 在转向这些Amazon Managed Services之前,存在关于数据库迁移后我们的应用程序表现如何的数据库焦虑或担忧。 但是,Amazon提供了灵活的方法来将本地本地数据库迁移到AWS数据库。

    There are benefits of moving to AWS databases:

    迁移到AWS数据库有很多好处:

    AWS提供完全托管的数据库服务 (AWS Provides fully Managed Database services)

    Before moving to AWS Migrations services or techniques, Let me introduce some AWS Managed database services which On-Premises users can avail.

    在转向AWS迁移服务或技术之前,让我介绍一些本地用户可以使用的AWS托管数据库服务。

    Relational databases comprises of Oracle, MySQL, Microsoft SQL Server, PostgreSQL and MariaDB.

    关系数据库包括Oracle,MySQL,Microsoft SQL Server,PostgreSQL和MariaDB。

    Non Relational databases comprises of MongoDB, CASSANDRA, Redis and MemCacheD.

    非关系数据库包括MongoDB,CASSANDRA,Redis和MemCacheD。

    Amazon RDS Service : You can use plethora of other databases in RDS such as Microsoft SQL server, Oracle, Amazon Aurora, MySQL, PostgreSQL and MariaDB. These are easy to deploy or Maintain, Scalable, Durable and Secure & compliant. It offers multi-AZ data replication, automated backup and snapshots.

    Amazon RDS服务:您可以在RDS中使用大量其他数据库,例如Microsoft SQL Server,Oracle,Amazon Aurora,MySQL,PostgreSQL和MariaDB。 这些易于部署或维护,可扩展,持久且安全且合规。 它提供多可用区数据复制,自动备份和快照。

    Amazon Aurora Service :Amazon Aurora is a MySQL and PostgreSQL-compatible relational database built for the cloud, that combines the performance and availability of traditional enterprise databases with the simplicity and cost-effectiveness of open source databases.

    Amazon Aurora服务: Amazon Aurora是为云构建MySQL和PostgreSQL兼容关系数据库 ,将传统企业数据库的性能和可用性与开源数据库的简单性和成本效益相结合。

    Amazon Aurora is up to 5 times faster than standard MySQL databases and 3 times faster than standard PostgreSQL databases. It provides the security, availability, and reliability of commercial databases at 1/10th the cost. Amazon Aurora is fully managed by Amazon Relational Database Service (RDS), which automates time-consuming administration tasks like hardware provisioning, database setup, patching, and backups.

    Amazon Aurora比标准MySQL数据库快5倍,比标准PostgreSQL数据库快3倍。 它以1/10的成本提供了商业数据库的安全性,可用性和可靠性。 Amazon Aurora由Amazon Relational Database Service(RDS)完全管理,该服务可自动执行耗时的管理任务,例如硬件置备,数据库设置,修补和备份。

    Amazon Aurora 亚马逊极光

    Amazon DynamoDB Service : Amazon DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale. It’s a fully managed, multi-region, multi-master, durable database with built-in security, backup and restore, and in-memory caching for internet-scale applications. DynamoDB can handle more than 10 trillion requests per day and can support peaks of more than 20 million requests per second.

    Amazon DynamoDB服务: Amazon DynamoDB是一个键值和文档数据库,可在任何规模上提供一位数毫秒的性能。 它是一个完全托管的,多区域,多主机,持久的数据库,具有针对Internet规模应用程序的内置安全性,备份和还原以及内存中缓存。 DynamoDB每天可以处理超过10万亿个请求,并且可以支持每秒超过2000万个请求的高峰。

    Amazon DynamoDB 亚马逊DynamoDB

    AWS迁移工具 (AWS Migration Tools)

    你在等什么 ? (What are you waiting for ?)

    “If a company like Amazon can move so many databases used by so many decentralised , globally distributed teams from Oracle to AWS, its really within the reach of almost any enterprise”

    “ 如果像亚马逊这样的公司可以将如此分散的,遍布全球的分散团队使用的这么多数据库从Oracle迁移到AWS,那么几乎所有企业都可以使用它 ”

    AWS offers flexible ways to help you migrate :

    AWS提供了灵活的方法来帮助您迁移:

    Flexible ways to Migrate 灵活的迁移方式

    With AWS Migration Tools, you can choose tools and techniques as per your business case. Here is the list of several tools which AWS offers.

    借助AWS迁移工具,您可以根据业务案例选择工具和技术。 以下是AWS提供的几种工具的列表。

    AWS DMS — Database Migration Service : It is a Database migration and replication managed service which can easily and securely migrate and/or replicate your databases and data warehouse to AWS. It can be used to migrate between different variety of databases engines.

    AWS DMS —数据库迁移服务 :这是一个数据库迁移和复制托管服务,可以轻松安全地将数据库和数据仓库迁移和/或复制到AWS。 它可用于在各种数据库引擎之间迁移。

    AWS SCT — Schema conversion tool : This offers development tooling to convert schemas between databases and data warehouses. SCT automates schema conversion including table structure and its associate code. This is also referred to as Object Migration. SCT helps minimises manual effort of performing a schema re-rewrite. This also allows conversion from commercial databases to open source platforms.

    AWS SCT —模式转换工具 :该工具提供了开发工具,可在数据库和数据仓库之间转换模式。 SCT自动进行包括表结构及其关联代码在内的模式转换。 这也称为对象迁移 。 SCT有助于最大程度地减少执行模式重写的手动工作。 这也允许从商业数据库到开源平台的转换。

    AWS Migration Tools AWS迁移工具

    There are two types of migration process; Heterogeneous and Homogeneous.

    迁移过程有两种类型: 异构和同质的。

    For heterogenous migrations (e.g., Oracle to Aurora PostgreSQL or Aurora MySQL, and Cassandra to Amazon DynamoDB), we can use Schema Conversion Tool(SCT)

    对于异构迁移(例如,从Oracle到Aurora PostgreSQL或Aurora MySQL,以及从Cassandra到Amazon DynamoDB的迁移),我们可以使用模式转换工具(SCT)

    For heterogenous migrations — SCT 对于异类迁移— SCT Amazon DMS steps Amazon DMS步骤

    3. Best Practice — AWS Migration Play books : These play books provide Topic-by-Topic overview of how to migrate databases and data warehouse to AWS services. This covers all proprietary features and the different database objects. Pay books offers best practices to migrate following migrations:

    3. 最佳实践-AWS迁移手册:这些手册提供了有关如何将数据库和数据仓库迁移到AWS服务的逐主题概述。 这涵盖了所有专有功能和不同的数据库对象。 薪资书提供了以下迁移的最佳做法:

    Oracle to Aurora PostgreSQL

    从Oracle到Aurora PostgreSQL Oracle ro Aurora MySQL

    Oracle ro Aurora MySQL SQL Server to Aurora MySQL

    从SQL Server到Aurora MySQL SQL Server to Aurora PostgreSQL

    SQL Server到Aurora PostgreSQL Oracle Data warehouse to Amazon Redshift

    从Oracle数据仓库到Amazon Redshift

    We recommend that you go through the best practices in the playbook’s short introduction, which contains an overview of how to use it as your migration guide.

    我们建议您仔细阅读剧本的简短介绍中的最佳做法,其中简要介绍了如何将其用作迁移指南。

    演示—从Oracle到Amazon RDS — MySQL (DEMO — Oracle to Amazon RDS — MySQL)

    Make a new project in SCT. You will be presented with three options, Transactional database (OLTP), Data warehouse (OLAP) and NoSQL database. Since we are dealing with transactional databases we will go for first option.

    在SCT中创建一个新项目。 您将看到三个选项,事务数据库(OLTP),数据仓库(OLAP)和NoSQL数据库。 由于我们正在处理事务性数据库,因此我们将首选。

    2. Connect to Oracle :Choose Connect to Oracle. In the Connect to Oracle dialog box, enter the following information, and then choose Test Connection.

    2.连接到Oracle:选择连接到Oracle 。 在“ 连接到Oracle”对话框中,输入以下信息,然后选择“ 测试连接” 。

    3. Choose OK to close the alert box, then choose OK to close the dialog box and to start the connection to the Oracle DB instance. The database structure of the Oracle DB instance is shown. Select only the HR schema.

    3.选择“ 确定”关闭警报框,然后选择“确定”关闭对话框并开始与Oracle数据库实例的连接。 显示了Oracle数据库实例的数据库结构。 仅选择HR模式。

    4. Expand HR

    4.扩大人力资源

    5. Choose Connect to Amazon RDS. In the Connect to Amazon RDS dialog box, enter the required information and then choose Test Connection.

    5.选择连接到Amazon RDS 。 在“ 连接到Amazon RDS”对话框中,输入所需信息,然后选择“ 测试连接” 。

    6. Right-click the HR schema and select Create Report.AWS SCT analyses the HR schema and creates a database migration assessment report for the conversion to Amazon MySQL.

    6.右键单击HR模式,选择创建报告 .AWS SCT分析HR模式并创建转换到亚马逊MySQL数据库迁移评估报告。

    Create Report 建立报告 Assessment Report 评估报告

    7.Right-click the HR schema, and then choose Convert schema.

    7.右键单击HR模式,然后选择转换模式 。

    8.Choose the HR schema, and then choose Apply to database to apply the schema scripts to the target Amazon RDS — MySQL instance, as shown following.

    8.选择HR模式,然后选择Apply to database将模式脚本应用于目标Amazon RDS-MySQL实例,如下所示。

    The database schema has now been converted and imported from source to target.

    现在已将数据库模式转换并从源导入到目标。

    数据库迁移到AWS Redshift: (Database Migration to AWS Redshift:)

    If you want to migrate your database to AWS warehouse such as Amazon Redshift then you will have following given benefits

    如果您要将数据库迁移到诸如Amazon Redshift之类的AWS仓库,那么您将获得以下好处

    Benefits of using AWS data warehouse 使用AWS数据仓库的好处

    Amazon Redshift : Amazon Redshift is a fully managed, petabyte-scale data warehouse service in the cloud. Amazon offers a lot of benefits as described in below image :

    Amazon Redshift:Amazon Redshift是云中完全托管的,PB级的数据仓库服务。 亚马逊提供了很多好处,如下图所示:

    AWS Redshift AWS Redshift

    Know what to expect during the migration journey.

    知道在迁移过程中会发生什么。

    Migration Journey 移民之旅

    We will use the Amazon DMS and SCT for warehouse migration :

    我们将使用Amazon DMS和SCT进行仓库迁移:

    DMS and SCT — Warehouse Migration DMS和SCT —仓库迁移

    We will extract date from data warehouse and migrate to Amazon Redshift. For this we will have to following given steps :

    我们将从数据仓库中提取日期,然后迁移到Amazon Redshift。 为此,我们将必须执行以下给定步骤:

    Extracts data through local migration agents

    通过本地迁移代理提取数据 Data is optimised for Amazon Redshift and saved in local files

    数据针对Amazon Redshift进行了优化,并保存在本地文件中 Files are loaded to an Amazon S3 bucket through network or AWS snowball edge and then to Amazon Redshift.

    文件通过网络或AWS雪球边缘加载到Amazon S3存储桶,然后再加载到Amazon Redshift。

    Given image shows the conversion process from Source DW to Amazon Redshift.

    给定的图像显示了从Source DW到Amazon Redshift的转换过程。

    Source DW to Amazon Redshift 从DW到Amazon Redshift

    I hope this blog is helpful if you are planning to migrate your on-premises or legacy database and warehouse to AWS Managed database services.

    如果您打算将内部部署或旧数据库和仓库迁移到AWS Managed Database Services,希望该博客对您有所帮助。

    Please let me know if you have any additional questions surrounding this blog.

    如果您对此博客有其他疑问,请告诉我。

    Note : Information and Images are used from AWS official webcasts.

    注意:信息和图像来自AWS官方网络广播。

    翻译自: https://medium.com/@praveen.kasana/database-migration-using-aws-2090595d4df6

    aws 数据库迁移

    相关资源:云迁移实践指南-将服务迁移到 AWS
    Processed: 0.009, SQL: 8