My table is moving from MySql to DynamoDb. I have a table:
Customers (column: cid [ PK], name, contact information)
Hardware (column: hid [PK], name, type)
Rent (column: get rid of [PK], cid, hidden, time). => This is the customer and hardware Project association.
One customer can have many hardware items, and one hardware item can be shared among many customers.
Requirements: separate customer lists and hadware projects should Ability to retrieve.
Lease details – which customer borrowed which Hardeware Item.
I mentioned this – the secondary index table. This is about keeping all the columns in one table.
I want There are 2 DynamoDb tables:
Customers-this has all properties similar to columns and a set of hardware item hash keys. (Then my problem is that when querying the customer table to retrieve only customers, all hardware is also loaded Key.)
May I have any guidance on the structure of the table? How to save, load and even update?
May I ask any java samples? (Can’t find any useful resources similar to my scene)
DynamoDB does not support foreign keys. Each table is independent and there is no special tool for keeping two tables in sync.
p>
You may have an attribute named hardwares in the customers table. This attribute will be a list of hardware IDs owned by the customer. If you want to view all hardware items belonging to the customer, you will:
>Execute GetItem for the customer ID. Or use query based on your opinion of the customer.
>For each hardware ID in the customer’s hardware attributes, please execute GetItem on the hardware table.
Use DynamoDB , You will usually end up performing more operations in the client application relative to the RDBMS solution. Its advantage is that it is fast and simple. But you will find that you may transfer a lot of work from the database server to the client server. /p>
I am new to NoSql and DynamoDb, but from RDBMS..
My table is moving from MySql to DynamoDb. I have a table:
Customers (column : Cid [PK], name, contact information)
Hardware (column: hid [PK], name, type)
rent (column: get rid of [PK], cid, hidden, time). => This is The association between customers and hardware projects.
A customer can have many hardware items, and a hardware item can be shared among many customers.
Requirements: separate customer list and The hadware item should be able to retrieve.
Lease details – which customer borrowed which Hardeware Item.
I mentioned this – the secondary index table. This is about keeping all the columns in one table.
I want to have 2 DynamoDb tables:
Customers-This has all attributes similar to columns and a set of hardware item hash keys. (Then my problem is that when querying the customer table to retrieve only customers, it will also Load all hardware keys.)
May I have any guidance on the structure of the table? How to save, load and even update?
May I ask any java samples? (Can’t find any useful resources similar to my scenario)
Please take a look at this answer, because it covers a lot of basic knowledge relevant to you.
DynamoDB does not support foreign keys. Each table is independent, and there is no special tool for keeping the two tables in sync.
You may have in the customers table An attribute called hardwares. This attribute will be a list of hardware IDs owned by the customer. If you want to view all hardware items belonging to the customer, you will:
>Execute GetItem on the customer ID. Or according to your opinion The customer’s opinion uses the query.
>For each hardware ID in the customer’s hardware attributes, please execute GetItem on the hardware table.
Using DynamoDB, you usually end up relative to the client application Perform more operations on the RDBMS solution. Its advantage is that it is fast and simple. But you will find that you may transfer a lot of work from the database server to the client server.
p>