The following blog post covers functions-as-a-service and serverless computing. Before we dive into functions, let us take a brief walk through the history...
It’s no secret that digital transformation has been driven by evolution in software. Software has progressively enabled levels of abstraction, from physical servers to virtual machines to containers to functions, thereby increasing the focus more-and-more on the code to be written and less-and-less on the infrastructure to be implemented. The figure below highlights this trend.
Physical servers offer high performance but provide the least flexibility for consolidation of workloads. Bare metal servers cannot decouple your applications from your underlying hardware -- your organization’s email system and payroll processing application deployed on a single server can affect each other’s performance and won’t generally be deployed together. The advent of VMware’s server virtualization product in 2001, followed by Xen and KVM hypervisors, enabled bare-metal resources to be abstracted into multiple operating system instances. Virtual machines (VMs) allowed you to decouple multiple workloads from a physical machine, thereby decreasing the concern for infrastructure implementation.
Next, Docker containers provided a light-weight alternative to VMs by abstracting out the operating system in addition to the bare metal hardware. As a result, containers encapsulated only the application and its dependencies, and served as a light-weight alternative to virtual machines. With Docker containers, developers could package their artifacts (i.e. code + app and dependencies) efficiently and be confident that what runs on their laptop would run in dev/test and in production.
“Functions” eliminate the work required from the developer to get the code running even more than containers. Functions, which run in containers, are snippets of code that can be executed based on events and API calls. Consider a couple of examples:
You have just provisioned an Autonomous Database on Oracle Cloud. You create a function that triggers off a successful database creation and then populates the database with tables and values. In doing so, you save the time and effort to wait for the database creation to complete and manually populate the database with data.
You have setup an object storage bucket to upload high resolution images. You create a function that triggers off new image uploads to the bucket, compresses them and emails you the compressed picture. Again, using a function saves you the effort needed to manually perform these steps.
In addition to these and other event-based use cases, functions can also be exposed as HTTP API endpoints. Web and mobile apps can use these endpoints to retrieve information from a backend database. For example, if you provide your zip code on a retailer’s website, the retailer can leverage functions to provide you with the stores in your area using its backend database with store-related information.
The term serverless seems to imply that there are no servers needed at all. I’m sure that’s not what was intended when the term was coined…. there are usually numerous servers deployed by the cloud provider to run your functions on the managed infrastructure and platform.
Serverless computing delegates infrastructure management (provisioning, configuration, and management) to a third party, such as Oracle Cloud. Oracle Autonomous Database, for example, supports a serverless deployment model, automating all aspects of the infrastructure and database management. Users can select the database type (Data Warehouse, Transaction Processing) and have their database provisioned in a few clicks.
Functions-as-a-Service allows you to execute functions on serverless infrastructure. An example of a FaaS offering is Oracle Functions, which is based off the open source Fn Project. Oracle Functions leverages containers and provides greater hybrid and multi cloud portability comparables. The service is autonomous: it provides autoscaling with no servers to provision and manage.
Learn more about Oracle Functions through these videos from Oracle and the community: Serverless on Oracle Cloud and Oracle Functions, Serverless, and IoT. The first video provides an overview of the Oracle Functions service and popular use cases. The second video touches on using an IoT device to leverage Oracle Cloud for functions.