Amazon DynamoDB - Scale and Benefits, But Does It Fit

I have an application that I built, if everything goes well, you can create a large amount of data. I am currently using a MySQL database to store information, and I am using INNER and LEFT for data filtering requests. Now I will have a game with dynamodb, but I thought I would ask if people think that it is suitable for the next data structure or should I use a relational database.

For example, let's say I had a project table with project_id as the primary key. Now each "project" could associate several users with it. Now that Manager A enters the system, he may want to see all the projects that his team members have. In the RDS model, this can be structured as follows:

**project** **project_to_user** project_id PK project_id project_title user_id select p.project_id,p.project_title from project as p inner join project_to_user as pto on p.project_id = pto.user_id WHERE pto.user_id IN( 1,2,3,4); 

Now I could theoretically preserve a similar structure for dynamodb, but first I would need to select all project_ids from project_to_user for each user_id (many reads) or, perhaps, to scan if user_id was a set of user_ids. Then I could select all projects based on the returned identifiers (possibly removing duplicates using code). As an alternative, I thought I could abandon the project_to_user table and get the user_ids attribute in the project and scan in that table. I know that scanning is not the best way to go with dynamodb, but can it be compensated by the person that the first way to do this can be read a lot anyway?

My application does not have a lot of tables, which I understand, which makes it a good candidate for amazon dynamodb, but should I stick to the relational model?

I know that this may seem fairly open, but I am worried about the prospect of large-scale DynamoDB offers, but I wonder if it is suitable for this kind of thing. However, I can see that DB management becomes a major headache along the line if I stick to the relationship model. I have already reworked the database in accordance with the dynamodb model, but it is these "JOINs" that indicate that I hesitate to take the jump and will be grateful for any ideas that people may have.

I have a little game with MongoDB in terms of getting used to NoSQL, but as I understand it, I would have to manage this setting more than with Amazon DynamoDB (which is a pro for Amazon)

Many thanks

* EDIT * There can be as many requests for user_id as there can be for project_id, if not more, but each project also needs to be identified separately

+4
source share
1 answer

This is the rule of thumb - if your queries are reachable with DynamoDB, then this works well. As for joins, you need to do this in your application level code.

If you can create tables in Dynamo to meet your needs, the benefits of a fully managed (zero administration) and infinite scale scales are advantages.

Recently, they support GSI, which makes requests more flexible.

0
source

Source: https://habr.com/ru/post/1393515/


All Articles