0

I have a table called "posts" which stores online blogs and articles. The data structure is different depending on the type of post. For now, there are 3: news, how-to, and vlog. Two more may be added in the future.

My table has the following attributes:

category (HASH) timestamp (RANGE)

I want to be able to pull only a few fields that are common to all posts (postId, title, postDate, author, category) from the table and limit the recordset to 10 records per page whenever a search term is found in ANY of the fields.

I also want to be able to pull every field when a postId is specified (postID is not a key field but it is unique).

What is the best way to accomplish this with DynamoDB?

Keith Harris
  • 1,118
  • 3
  • 13
  • 25

1 Answers1

0

I also want to be able to pull every field when a postId is specified (postID is not a key field but it is unique).

This can be easily done using an index on postId, selecting all projected attributes.

I want to be able to pull only a few fields that are common to all posts (postId, title, postDate, author, category) from the table and limit the recordset to 10 records per page whenever a search term is found in ANY of the fields.

This is a bit tricky, as it's more of a search problem, most suitable for ElasticSearch, for example. You could use both these solutions, depending on your querying needs.

Horatiu Jeflea
  • 7,256
  • 6
  • 38
  • 67