How to migrate relational data from a relational SQL DB to NoSQL DB with DMS

0

We're testing DMS for syncing our main SQL (PostgreSQL) database into NoSQL (OpenSearch). I've read about tasks, rules & table mappings, but it's not clear what is the preferred way to sync relational data into a non-relational DB, specifically PostgreSQL into OpenSearch.

First of all, a few PostgreSQL tables will be migrated to the same OpenSearch index, by flattening the relations into the main document. This means that there should be probably be an order to the sync.

For example, let's say in PostgreSQL there is a "Users" table and "UserRoles" table (say 1 to many) where each user role has a user id. And in OpenSearch we have only a "Users" index where each user document can have an array of nested "role" objects (or just an array of strings).

Then I would assume that first the "Users" table should be migrated to the "Users" index, and only after that the "UserRoles" table should be migrated by adding a nested object in the "Users" index. How would that be done? Is there a way to control the order DMS syncs the tables? Also, how do I tell DMS that "UserRoles" should be migrated as a nested object and that it should first find the existing user by the user id?

2 個答案
0

There is a good blog that talks about migrating from a relational database to DocumentDB, which is a Document Datastore - https://aws.amazon.com/blogs/database/migrating-relational-databases-to-amazon-documentdb-with-mongodb-compatibility/

profile pictureAWS
專家
已回答 2 年前
0

Unfortunately he blog just says how to setup migration between a relational DB & a NoSQL, but doesn't go into details about transforming SQL relations tables into a flattened NoSQL collection (or index, in case of OpenSearch). See my original question for the exact problems I'm facing.

已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南