educative.io

Educative

Can you give an example of Partition key and Sort key combined together?

In this chapter, you have given an example of only a Partition Key.

Can you give an example of Partition key and Sort key and how it is being used?

Hi @DUSMANT_KUMAR_PATI

Partition key and sort key: Referred to as a composite primary key , this type of key is composed of two attributes.

  • The first attribute is the partition key .
  • the second attribute is the sort key .

All data under a partition key is sorted by the sort key value. The following is an example.