hboss
hboss

Reputation: 1

elasticsearch to Mongodb migration - uuid data

I'm checking the option to migrate an index from elasticsearch to mongodb.

In my Elasticsearch index, the _id of each document is generated on another service, which insert a new document to the index with predefined _id (which is a postgres uuid type).

I want to migrate this index from elasticsearch to mongodb because we decided that elasticsearch is overkill to managing one index which we mostly use for OLTP.

I'm a dba, but I'm new to mongodb - based on what I found so far I have 2 options:

  1. Import documents where I set the _id to be a type of string with the string value of the uuid
  2. Import documents where the uuid type is converted to BinData.

we are working mostly with the uuid values (we have multiple services which use UUID with postgres) and they are related to one another.

my questions regarding this:

  1. how much storing string as _id is bad? assuming we create about 3 million documents a month
  2. When I use postgres as a medium, and studio 3t to migrate from postgres to mongo, its automatically generating _id as BinData type 0. is it ok?
  3. is postgres uuid is equivelant to BinData type 3 or 4?
  4. if the application should search based on UUID, what should be the process of getting documents from mongo db in a case that we store it as BinData? should the app do the convertion or should it be done inside mongo?

i.e. every resource is AWS based - so RDS Postgres, Elasticsearch and DocumentDB

Thank you very much :)

Upvotes: 0

Views: 242

Answers (0)

Related Questions