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

147
Visualizações
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 à 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