Background information
You have ApsaraDB RDS for MySQL resources that reside in regions that are not supported by OpenSearch.
You have requirements for document searches.
OpenSearch can connect to only ApsaraDB RDS for MySQL instances or PolarDB for MySQL instances that reside in the same region.
You have self-managed MySQL databases and want to use the document search feature of OpenSearch.
Select a solution
Requirements:
ApsaraDB RDS for MySQL or PolarDB for MySQL instances can be connected to OpenSearch across regions.
Data of ApsaraDB RDS for MySQL or PolarDB for MySQL instances that reside in an unsupported region can flow to a supported region of OpenSearch.
Data can flow to OpenSearch with ensured ordering, consistent data structure, and no data loss.
Full or incremental data can be imported to OpenSearch.
Solutions:
Non-real-time solution: Data of your ApsaraDB RDS for MySQL or PolarDB for MySQL instances is transmitted to MaxCompute first and then to OpenSearch.
Real-time solution: Data of your ApsaraDB RDS for MySQL or PolarDB for MySQL instances that reside in another region is migrated to ApsaraDB RDS for MySQL or PolarDB for MySQL instances in the same region as your OpenSearch service by using Data Transmission Service (DTS). Then, the data is transmitted to OpenSearch.
Real-time solution: Full data of your ApsaraDB RDS for MySQL or PolarDB for MySQL instances that reside in another region is migrated to ApsaraDB RDS for MySQL or PolarDB for MySQL instances in the same region as your OpenSearch service by using DTS. Then, the data is pushed to OpenSearch. Data can be pushed to OpenSearch by calling API operations as well.
Comparison:
Data source | Full data | Incremental data | Resource usage | Degree of difficulty | Possible cost |
DTS | Supported | Supported | AparaDB RDS and DTS full data migration and incremental data migration resources | Low | ApsaraDB RDS bills and DTS daily bills |
MaxCompute | Supported | Supported (scheduled tasks by day) | MaxCompute subscription-based Standard Edition, exclusive clusters, Cloud Enterprise Network, and resources for resource access authorization and region-based access control | High | Fees for MaxCompute resources and exclusive clusters |
Data import by using the API or SDK and DTS data migration | Supported | Supported | Resources for development and debugging, and DTS full data migration | Medium | ApsaraDB RDS bills and DTS bills for full data migration |
Procedure
Create an ApsaraDB RDS for MySQL or PolarDB for MySQL instance in the specified region.
Purchase an ApsaraDB RDS for MySQL or PolarDB for MySQL instance in the specified region.
Create a database and a management account. You must have DDL and DML permissions on the database.
Create and configure a DTS task.
Purchase a DTS instance. If you have not activated DTS, you must activate it first.
Select the specified region for your OpenSearch service and configure a DTS data migration task.
For more information about how to configure a DTS data migration task, see Data migration.
If you want to migrate instances across regions, the source ApsaraDB RDS for MySQL instance must be connected over a public network. Request a public IP address in the ApsaraDB RDS console.
You do not need to modify the whitelist of the ApsaraDB RDS for MySQL instance. If only 127.0.0.1 is retained in the IP address whitelist, the connectivity check can be passed.
Create an OpenSearch application instance.
After the full data migration task is complete for the ApsaraDB RDS for MySQL or PolarDB for MySQL instance in the specified region, configure the OpenSearch application instance.
Configure an ApsaraDB RDS for MySQL or PolarDB for MySQL data source for the OpenSearch application instance. For more information, see Data sources by choosing Instance management > Configure applications in the OpenSearch documentation.
The real-time data transmission performance depends on the nodes for DTS data migration and data import of OpenSearch. No significant difference exists in data transmission latency. For more information about the usage of OpenSearch, refer to the OpenSearch documentation.
For more information about the limits on DTS data migration tasks, configuration rules, and billing methods, refer to the following topics: