Implementing zero-infrastructure web content in less than 5 minutes

Timothy McCallum
Wasm
Published in
5 min readNov 11, 2020

This article shows you how to implement cutting-edge information technology (IT) services without any of the traditional costs associated with server-side infrastructure. How? By implementing Function as a Service (FaaS) technology.

Image by Elias Sch. Pixabay

Advantages of Function as a Service (FaaS) technology

When we refer to costs, we are not only talking about the costs of physically running and maintaining on-premises (in-house) server infrastructure. These costs are huge, granted! FaaS technologies also help reduce loss of revenue as agile competitors (like startups) attempt to displace traditional businesses (which have slower and less agile IT infrastructure).

Lean startups move along two intertwined paths a) modifying and adapting their value proposition to changing market conditions and b) innovating their business model (Ghezzi and Cavallo, 2020).

The FaaS architecture allows businesses to respond more quickly to customer & user demands, even facilitating the hot-swapping of business logic live in production (without the need to upgrade, reconfigure and restart systems). FaaS has many more features on offer, we will cover some of those in point form at the end of this article. Right now, let’s see if we can dive in and implementing zero-infrastructure web content in less than 5 minutes.

Implementing FaaS technology in under 5 minutes

Step 1 - For today’s demo, we will just whip up a quick GitHub pages site. To follow along, simply create a quick GitHub repository (or just clone mine).

Note: You can also just write to a local HTML file and open it in your browser using the file://path_to_your.html

As you can see, the GitHub repository only has one single HTML page (source code available here). Super easy to implement.

Step 2 - Once your GitHub repository is created, clicking on the “Settings” tab (as shown in the image above) will take you to a new area where you can scroll down to find the section called “GitHub Pages”.

If you enable “GitHub Pages” for the repository that HTML file will be instantly published at a specified URL (as shown in blue text above).

The following image is a screen capture from my published repository.

The FaaS request/response component of this HTML page is a secure HTTP request (as shown in the following code snippet).

.

This request executes a function called say which we wrote and deployed earlier. Source code available here. Whilst the example above is a very simple one, it shows just how easy it is to deploy outward facing web content which sports FaaS integration.

If 5 minutes is all the time you had spare today, then thanks for reading! Hope you enjoyed the article and the demo.

If you have a few more minutes, please read on past the chequered flag :)

Cutting-edge FaaS examples

Please visit SecondState’s FaaS page to find more examples, including functions for image classification, face detection, image watermarking and even sending email via FaaS.

As you can now see, FaaS infrastructure (such as the FaaS on offer from SecondState) allows you to supercharge your Apps; implementing advanced AI and Machine Learning and making these available to Apps via the Web.

These AI, machine learning and image manipulation examples, from above, are all publicly available and can be easily integrated into your applications. Let’s take a look at some additional benefits of implementing SecondState’s FaaS.

Benefits of implementing SecondState’s FaaS

  • all functions run in a stand-alone stack-based WebAssembly (Wasm) Virtual Machine (VM)
  • Safe execution, no side effects between functions and/or users
  • functions can toggle between public and private (openly available to others vs exclusively available)
  • no lock-in contracts, only pay for what you use
  • currently free (still in Beta)
  • ephemeral storage and permanent storage options are available
  • all requests and responses are secure (HTTPS)
  • no username required
  • no passwords required
  • no cloud authentication (identity management) required
  • not locked into any cloud specific nuances (custom data formats or authentication methods etc.)
  • SecondState’s FaaS is cloud-agnostic (function calls are simply made over the open web)
  • facilitates web programming functionality such as callbacks, web hooks, remote data fetching and more
  • can be called by any programming language (capable of making HTTP requests i.e. Python, PHP, Rust, JS, Nodejs, Curl, Go, Java, C, Ruby and more)
  • offers fast execution via AOT compiled binaries

Create your own

SecondState provides 1/2 dozen FaaS deployment tutorials, which should be more than enough to get you up to speed with creating and deploying your very own FaaS functions.

Programming the Web

The aforementioned FaaS system supports the programmable Web. Please see this more in-depth article which dives into how to use FaaS infrastructure to program the Web. The article also provides examples of how to write and deploy your own FaaS executables using the Rust programming language.

Keeping up to date

You can also stay up to date by visiting the SecondState website or by following their Twitter.

https://twitter.com/secondstateinc

References

Ghezzi, A. and Cavallo, A., 2020. Agile business model innovation in digital entrepreneurship: Lean startup approaches. Journal of business research, 110, pp.519–537.

--

--

Timothy McCallum
Wasm
Editor for

I'm a technical writer and copy editor exploring WebAssembly (Wasm), software automation, and Artificial Intelligence (AI) while mastering Rust, Python, & Bash.