Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda