Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!