1

I have a db design that requires a many 2 many 2 many.

  • ObjectA can have multiples of ObjectB

  • ObjectB can have multiples of ObjectC

  • ObjectB can have multiples of ObjectD

  • ObjectC can have multiples of ObjectE

  • ObjectB can have multiples of ObjectE

I dug up this post about adjacent lists. It makes sense for the simpler model they are dealing with.

The other thing I should add is I don't want to duplicate data. For instance I am storing addresses in ObjectB, I want those to be unique. I was thinking of just Base64 encoding the entire address line and using that for hash key.

I have two questions:

  1. is dynamo the correct database to use for this?

  2. What would the data model look like in dynamo?

dev
  • 39
  • 8

1 Answers1

1

I think the answer to you question is actually in the question itself. You want to have many to many relationships in a NoSQL (non relational) DB. Despite being able to achieve your goal with Dynamo, this will implicate a lot of unnecessary problems. I suggest you change the direction and go with RDS, the SQL Service of AWS.

AlexK
  • 1,380
  • 10
  • 17
  • That is a fair point and is what i was thinking. The only draw back I can think of is I am using lambda, and at scale is connection limit to RDS. But thank you for the response. – dev Nov 13 '18 at 18:17
  • There are workarounds to this. You can search a bit on the matter and you will find a lot of information. Simply put, you can achieve connection pooling by creating connections out of the handler scope. Check this https://forums.aws.amazon.com/thread.jspa?threadID=216000 – AlexK Nov 13 '18 at 18:25
  • I was able to get this easily working in SQL. Thanks for the advice. – dev Nov 15 '18 at 21:48