PolarDB O Edition provides the database link (DBLink) feature for you to access data across databases.

For example, you can create a database link of Database B in Database A. Then, Database A can use the database link to access the data stored in Database B in the same way as Database A accesses its own data. In this case, two-way data access cannot be implemented. If Database B needs to access the data stored in Database A, you must create a database link of Database A in Database B.

Scenarios

PolarDB O Edition supports two types of database links: database links from some PolarDB O Edition clusters to other PolarDB O Edition clusters and database links from PolarDB O Edition to user-created PostgreSQL databases hosted on Elastic Compute Service (ECS) instances.

  • Scenario 1: Database links from PolarDB O Edition to user-created PostgreSQL databases hosted on ECS instances

    You previously used a user-created PostgreSQL database that is hosted on an ECS instance. When you migrated the services to PolarDB O Edition, only part of the business systems were migrated to PolarDB O Edition due to some reasons. In this scenario, the remaining services are still deployed in the user-created PostgreSQL database that is hosted on the ECS instance. Data access is required between the business systems that were migrated and the remaining services. Therefore, two-way data access must be implemented between the PolarDB O Edition database and the user-created PostgreSQL database hosted on the ECS instance to ensure that your business runs as expected. To implement two-way data access, create a database link from the user-created PostgreSQL database hosted on the ECS instance to PolarDB O Edition. You must also create a database link from PolarDB O Edition to the user-created PostgreSQL database hosted on the ECS instance.

    Database link from PolarDB-O to a user-created Oracle database hosted on an ECS instance
  • Scenario 2: Database links from some PolarDB O Edition clusters to other PolarDB O Edition clusters

    Due to business requirements, you use two PolarDB O Edition clusters. Assume that the two clusters are PolarDB O Edition cluster A and PolarDB O Edition cluster B and the two clusters store data sets of different services. Two-way data access is required between the data sets of different services. To implement two-way data access between the two databases, create a database link from PolarDB O Edition cluster A to PolarDB O Edition cluster B and a database link from PolarDB O Edition cluster B to PolarDB O Edition cluster A.

    Database link from a PolarDB-O cluster to another PolarDB-O cluster