How to access AWS EMR from any frontend framework

I am working on a project that uploads a dataset from a webpage and in the backend it need to run Map and Reduce program in AWS EMR, can anyone give me idea how to do this

The way I’ve done this is to upload the file to S3 using a presigned url. S3 put object event is triggered to a sqs queue or directly to a lambda (my preference is sqs then → lambda). In parallel I write to a process log in dynamodb that has an event stream enabled; START processing XYZ.

The lambda uses the AWS SDK to start the EMR job; Spark in my case. Spark reads the file content from S3 and does it’s work; writes to the same process log; END (or FAIL) processing XYZ. Update the frontend via the process log events re: job status.

You can use AWS SDK for JavaScript to achieve whatever you want. But I recommend you create a backend for handle files upload and run EMR task (+ more secure than just use frontend for everything).

Thanks for the help. backend node js support for aws is what you are suggesting?

Could be more secure by if you use auth through cognito to then call backend services then that’s also secure, even with an SPA running on S3.

For backend stuffs, you can pick whatever programming language you familiar with and SDK for JS (Node.js) is very solid choice :slight_smile:

This is exactly how I’ve done yet as well, very common design pattern to use

same process log; END (or FAIL) processing XYZ. Update the frontend via the process log events re: job status.

Thanks for the help! I have created a frontend using react and with the help of lambda function and API gateway I have successfully uploaded the dataset to S3 bucket.
Im working on how to run the EMR job and send the response back to the frontend.