Search in list data type in dynamo db aws

后端 未结 1 1975
悲&欢浪女
悲&欢浪女 2020-12-21 05:31

We are using dynamo db as our database solution for one of our sites. we are storing data in dynamo db as per below given json.

We have video which can belong to one

相关标签:
1条回答
  • 2020-12-21 06:09

    There is on thing about NoSQL is that it wont fit every where, but I had similar situation with my client, here is my solution:

    videoMaster (videoId(hash), desc, link ..etc)
    tagDetail (tagId(hash), videoId(Range))
    

    Now you can query by passing tagId (kids, study..etc) you will get all the videos of particular tags

    Your data in tagDetail will look something like:

    kids -> video1
    kids -> video2
    Education -> video1
    Education -> video3
    

    Problem with the above solution: If you have billions of videos in one particular tag then your performance will be affected as the Hash is not distributed properly.

    Small Tip: You can implement caching mechanism for your table reads so that you don't have to query your database every time.

    0 讨论(0)
提交回复
热议问题