Database Reference
In-Depth Information
The first method is not advised and the second is most suitable. Before discussing the
reason, let's explore how this insertion works internally. The first insertion method will in-
sert the items into first partition and then to the second partition, and so on. So, it over-
loads one partition with too many writes (insertions). During that time, the other two par-
titions will be idle. That is the reason why the first insertion method is not ideal or the cor-
rect way of using the DynamoDB put item. So we must follow the second approach,
which will distribute the write requests uniformly across partitions.
Tip
Even though in our data we have only three unique hash attribute values (SCJP, Hadoop,
and Let us C), these kinds of binary and ternary hash values are not advised for Dy-
namoDB (this is discussed in the Item sharding section of this chapter).
Therefore, because of sharding (or horizontal partitioning), DynamoDB partitions not
only the table but also the index associated with the table, so the read requests will be
faster.
Search WWH ::




Custom Search