Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

175
Visualizações
How to Implement sorting in REST API with DynamoDB

I am trying to implement pagination + sorting of records in my rest API using dynamodb.

There are 4 attributes in the table:-

  • a - pk ( partition key)
  • b - SK (range key)
  • createdAt - normal attribute
  • updatedAt - normal attribute

Since dynamodb always sorts data by default on the range key. This will be a problem when I would like to sort based on created or updated with pagination as some data will be on page 1 for 2020 and 2021 years and some data on page 2 will be of 2022 and 2020 if the range key item starts with z ( just an example)

is there any workaround for this where we can sort dynamic data with pagination and other attributes that are not range key? Also i dont want to use index for the attributes as it can ensure cost

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you want to search more indices, you must create more indices. It sounds like you need local secondary indices on updated and created. Then when you sort by that, you switch your pagination to using the correct index.

And I understand that you don't want to pay, but that cost is precisely for what you seek, as far as I can tell.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda