dynamo db many to many to many relationships












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?











share|improve this question





























    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?











    share|improve this question



























      1












      1








      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?











      share|improve this question
















      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?








      amazon-web-services amazon-dynamodb data-modeling






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 '18 at 17:36







      Wolfie010

















      asked Nov 13 '18 at 17:11









      Wolfie010Wolfie010

      85




      85
























          1 Answer
          1






          active

          oldest

          votes


















          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.






          share|improve this answer
























          • 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.

            – Wolfie010
            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 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.

            – Wolfie010
            Nov 15 '18 at 21:48











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53286274%2fdynamo-db-many-to-many-to-many-relationships%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          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.






          share|improve this answer
























          • 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.

            – Wolfie010
            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 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.

            – Wolfie010
            Nov 15 '18 at 21:48
















          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.






          share|improve this answer
























          • 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.

            – Wolfie010
            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 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.

            – Wolfie010
            Nov 15 '18 at 21:48














          1












          1








          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 13 '18 at 18:01









          AlexKAlexK

          824413




          824413













          • 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.

            – Wolfie010
            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 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.

            – Wolfie010
            Nov 15 '18 at 21:48



















          • 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.

            – Wolfie010
            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 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.

            – Wolfie010
            Nov 15 '18 at 21:48

















          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.

          – Wolfie010
          Nov 13 '18 at 18: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.

          – Wolfie010
          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 forums.aws.amazon.com/thread.jspa?threadID=216000

          – AlexK
          Nov 13 '18 at 18:25





          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 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.

          – Wolfie010
          Nov 15 '18 at 21:48





          I was able to get this easily working in SQL. Thanks for the advice.

          – Wolfie010
          Nov 15 '18 at 21:48


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53286274%2fdynamo-db-many-to-many-to-many-relationships%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Xamarin.form Move up view when keyboard appear

          JBPM : POST request for execute process go wrong