AWS Web App Hosting


Our team is building WasmFiddle, a browser-based code sandbox which allows a user to write C/C++/Rust and view the result of executing the code. Some of the options for hosting that we explored were:

  • Run the app locally – requires providing deployment instructions for viewing and grading
  • Host on a “Platform-as-a-Service” website (eg Heroku) – probably the easiest option but with Heroku dashing our dreams and canceling their free tier, that option became less appealing
  • Host on a cloud provider (AWS, GCP, Azure) – the most complex option but provides massive flexibility and brings some interesting cloud experience to the project

After some discussion, the group settled on Amazon Web Service to host the app.

Upon landing on the AWS website, we quickly realized that with great power comes great… complexity.

After quickly becoming overwhelmed with the options, I attempted to narrow down the search by identifying the needs of our project to hone in on which services we may actually need to employ.

WasmFiddle, at a high level, is a static web page front-end which presents a text box for code entry, a display for output, and some sort of back-end which can provide the necessary compute to compile Web Assembly, and send back the results of execution.

Front End

For static web page hosting, there are a couple of options depending on a user’s desired level of control and tolerance for complexity. The web page could be stored directly in AWS Simple Storage Service (S3) but this requires a number of peripheral services to bring the project to life. We elected to host the front end through Amplify.

Amplify provides a dashboard and full service for developing, deploying, and hosting single page web apps. Perfect! Through Amplify, we’re able to quickly and easily host our page as well as integrating into our Github workflows for both production and development branches so changes to the code base are reflected on the hosted site in near real-time.

Back End

While we may include a database for holding user accounts and configurations as a stretch goal, the core product of WasmFiddle only requires a server to handle execution of NodeJS functions.

Amazon provides a plethora of compute services which could all serve our use-case. Perhaps AWS most widely known (and widely used?) service, Elastic Compute Cloud (EC2) enables a user to provision reliable, highly available compute with full control over things like processor architecture, operating system, memory, etc. This option would work wonderfully for our case but given the low request volume we expect, the VMs would go unused a majority of the time meaning we’d be paying for servers which aren’t being used.

After exploring a couple other options, I landed on Lambda. Lambda is an event-driven service which allows you to provision compute without ever thinking about servers. Lambda functions will be defined and accessed via Amazon’s API Gateway from our front-end. Each time a Lambda function is called, the necessary server capacity will be provisioned, our code is run, the result returned to our web app, and then the servers are torn down automagically.

While AWS appears quite daunting on the surface (and below the surface, honestly) I believe we have settled on the necessary services to host our app in a way that is easy to iterate on, is reliable, and can be widely provided for users to enjoy. Stay tuned!

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *