# How to access AWS EMR from any frontend framework

**URL:** <https://awshq.com/t/how-to-access-aws-emr-from-any-frontend-framework/14627>\
**Category:** AWS Cloud Talk\
**Created:** [March 20, 2022, 4:39am UTC](https://awshq.com/t/how-to-access-aws-emr-from-any-frontend-framework/14627 "2022-03-20T04:39:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![saiprasads7](https://awshq.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@saiprasads7](https://awshq.com/u/saiprasads7)\
**Post date:** [March 20, 2022, 4:39am UTC](https://awshq.com/t/how-to-access-aws-emr-from-any-frontend-framework/14627/1 "2022-03-20T04:39:17Z")

</div>

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

* * *

**Related discussions:**

- [Curated. Central. Application only. See you there? 11/29](https://awshq.com/t/curated-central-application-only-see-you-there-11-29/21781)
- [AWS ETC is being retired](https://awshq.com/t/aws-etc-is-being-retired/21634)
- [AWS re:Invent advice](https://awshq.com/t/aws-re-invent-advice/20725)
- [AI Co-Pilots Everywhere: The Future of Human Productivity#EkasCloud #AICopilot #ArtificialIntelligence #AI #FutureOfAI #HumanProductivity #GenerativeAI #MachineLearning #AIInnovation #Automation #DigitalTransformation #FutureTechnology #SmartWork #WorkplaceInnovation #AIApplications #TechTrends](https://awshq.com/t/ai-co-pilots-everywhere-the-future-of-human-productivity-ekascloud-aicopilot-artificialintelligence-ai-futureofai-humanproductivity-generativeai-machinelearning-aiinnovation-automation-digitaltransformation-futuretechnology-smartwork-workplaceinnovation-a/21768)
- [Neuromorphic Computing: Building Computers Like the Human Brain#NeuromorphicComputing #BrainInspiredComputing #ArtificialIntelligence #AI #FutureTechnology #NextGenComputing #BrainLikeComputers #NeuralNetworks #MachineLearning #DeepLearning #AIInnovation #AdvancedComputing #EmergingTechnologies](https://awshq.com/t/neuromorphic-computing-building-computers-like-the-human-brain-neuromorphiccomputing-braininspiredcomputing-artificialintelligence-ai-futuretechnology-nextgencomputing-brainlikecomputers-neuralnetworks-machinelearning-deeplearning-aiinnovation-advancedcom/21755)

---

<div class="post-metadata">

**Author:** ![akaender](https://awshq.com/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@akaender](https://awshq.com/u/akaender)\
**Post date:** [March 20, 2022, 5:50am UTC](https://awshq.com/t/how-to-access-aws-emr-from-any-frontend-framework/14627/2 "2022-03-20T05:50:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kei\_ichi](https://awshq.com/letter_avatar_proxy/v4/letter/k/ecccb3/32.png) [@kei\_ichi](https://awshq.com/u/kei_ichi)\
**Post date:** [March 20, 2022, 6:57am UTC](https://awshq.com/t/how-to-access-aws-emr-from-any-frontend-framework/14627/3 "2022-03-20T06:57:06Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![saiprasads7](https://awshq.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@saiprasads7](https://awshq.com/u/saiprasads7)\
**Post date:** [March 20, 2022, 7:52am UTC](https://awshq.com/t/how-to-access-aws-emr-from-any-frontend-framework/14627/4 "2022-03-20T07:52:34Z")

</div>

> [@kei\_ichi](#):
>
> 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?

---

<div class="post-metadata">

**Author:** ![untg](https://awshq.com/letter_avatar_proxy/v4/letter/u/d6d6ee/32.png) [@untg](https://awshq.com/u/untg)\
**Post date:** [March 20, 2022, 8:25am UTC](https://awshq.com/t/how-to-access-aws-emr-from-any-frontend-framework/14627/5 "2022-03-20T08:25:40Z")

</div>

> [@kei\_ichi](#):
>
> 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).

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.

---

<div class="post-metadata">

**Author:** ![kei\_ichi](https://awshq.com/letter_avatar_proxy/v4/letter/k/ecccb3/32.png) [@kei\_ichi](https://awshq.com/u/kei_ichi)\
**Post date:** [March 20, 2022, 9:24am UTC](https://awshq.com/t/how-to-access-aws-emr-from-any-frontend-framework/14627/6 "2022-03-20T09:24:51Z")

</div>

> [@saiprasads7](#):
>
> Thanks for the help. backend node js support for aws is what you are suggesting?

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

---

<div class="post-metadata">

**Author:** ![Chompy\_99](https://awshq.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@Chompy\_99](https://awshq.com/u/Chompy_99)\
**Post date:** [March 20, 2022, 11:42am UTC](https://awshq.com/t/how-to-access-aws-emr-from-any-frontend-framework/14627/7 "2022-03-20T11:42:05Z")

</div>

> [@akaender](#):
>
> 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 …

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

---

<div class="post-metadata">

**Author:** ![saiprasads7](https://awshq.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@saiprasads7](https://awshq.com/u/saiprasads7)\
**Post date:** [March 21, 2022, 6:17am UTC](https://awshq.com/t/how-to-access-aws-emr-from-any-frontend-framework/14627/8 "2022-03-21T06:17:28Z")

</div>

> [@akaender](#):
>
> 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 …

> 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.
