0

So I have an architecture in which the user uploads there file onto the front end, which then sends it to a s3 bucket, which in turn triggers a lambda for validation and processing, which sends the response to the front end of successful upload or validation error.

I don't understand if there is way to implement this in JavaScript (or any other similar language).

In the normal scenario, the front end uploads to server 1, and waits for it's response. The server 1 then tells the front end whether it was a success or a failure, and that is what the front end tells the user.

But in this case, the upload is done to s3 (which is incapable of taking responses from lambda, and send it back to the user), and response is to be expected from the other one (the lambda).

How can this be implemented? If the architecture is flawed, please do suggest improvements.

Mooncrater
  • 4,146
  • 4
  • 33
  • 62

1 Answers1

0

How does server 2 respond to the front end? Surely server 2 responds to server 1 which in turn responds to the front end. If these operations are synchronous then it is no different from calling a function or API call. If you wanted to make it asynchronous then you've got a different pattern to manage.

LoztInSpace
  • 5,584
  • 1
  • 15
  • 27
  • thanks for your reply. I have realized that I should have mentioned my use case specifically, so I have updated my question. So the problem is that, the s3 can not take triggers from the lambda and send response back to the front end. – Mooncrater Mar 26 '21 at 04:48