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

148
Vistas
How to make concurrent/parallel request to a non idempotent API in AWS Lambda?

I have an API for which I created a lambda function to hit it on the 1st of every month.

All the steps executed upon hitting the API:

  • Fetch all the users having their birthday in current month.
  • Create a gift card for each user and save that gift card into the gift card table.
  • Send gift codes to the users via mail.

NOTE: Each user needs to get a single gift card only. Another related thread by me.

Currently In my lamda I used a loop to hit the API(every time gift cards will be sent to only first 100 users and in the next time same query is run those users will not be returned by the query).

Since number of users can be very large I want to make concurrent requests so that lambda doesn't time out.

Query to fetch users: ? will be replaced with the current year and month

SELECT u.id, u.first_name, u.last_name, u.email, u.date_of_birth
FROM user u
LEFT JOIN gift_card gc ON
    DATE_FORMAT(gc.scheduled_at, '%Y') = ? AND
    gc.message = 'Happy birthday! from BURST' AND
    gc.status = 1 AND
    gc.recipient_email = u.email
WHERE
    DATE_FORMAT(u.date_of_birth, '%m') = ? AND
    u.email IS NOT NULL AND u.status = 10 AND
    gc.recipient_email IS NULL
LIMIT 100

After this I run another query to add gift card in gift table and then send the mail.

Is there any way to achieve this in node? maybe a different service or by using some other technique.

about 4 years ago · Santiago Gelvez
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