Database Reference
In-Depth Information
Problem statement - 2
Somebody was developing a freelancer platform for certain professionals. That developer
was thinking of utilizing AWS DynamoDB for logging user activity (such as posting a job,
hiring professionals, and so on). So he has done some work and selected some fields like
the ones in the following code:
user_id
ip_address
timestamp
data
After selecting these fields, he will be querying DynamoDB for the following information:
• Log of activity by selected users
• Log of all the user activity performed at a certain hour or on a certain day
The information will have to be saved and accessible for a long time. Now the question is:
how good will DynamoDB be for this kind of scenario?
Solution
DynamoDB is very famous for its high-performance retrieval. Basically, it uses solid-state
drive ( SSD ), so storage prices may be a little bit expensive if you are going to store that
data forever on it when talking about high volumes. Hence, Amazon DynamoDB can be
the perfect solution for you and the preferred solution for schema can be as follows:
hash_key = <user_id>:YYYY-MM-DD
range_key = full_ISO_8601_timestamp
ip_address
data
Here, ISO_8601 is all the time a superior initiative if you need to sort the dates.
The developer can even append the date to the user_id function to make queries easier
and to keep things logically grouped, but it will be complex for more advanced queries. So,
as a solution you can avoid that complexity by using the BETWEEN filter of Query .
Let's take another example of a company that offers a full suite of data protection and man-
agement solutions for enterprise laptops, PCs, smartphones, and tablets.
Search WWH ::




Custom Search