A user requires a production grade api that can be used to query data stored in an enterprise database quickly. In most fast paced environments, this scenario calls for implementing a serverless function using OpenFAAS running on a bare metal , datacenter or cloud based Kubernetes clusters.
Using the OpenFAAS command line interface (cli) a function is created using a python3-debian template. Using python libraries the function queries the database as detailed in a separate DevStory. The function, deployed to a Kubernetes cluster, is exposed as an endpoint behind an NGINX reverse proxy within a datacenter cluster or API Gateway on AWS.
Clients manually or programmatically call the function to retrieve data from the enterprise database. This architectural pattern has been used frequently on a trade floor to provide a secure, IT policy compliant, auditable and production scale api at high velocity and low code. It allows developers to be extremely responsive to user needs in fast paced environments.
Factoryzetm Functions as a Service provides an implementation of OpenFAAS deployable to a bare metal K8s cluster, Tanzu and Open Shift clusters in the data center and EKS, AKS and GKE in the cloud.
Complex deal type, contributing large positions to the commodity trading firm’s proprietary portfolio needed to be captured. ETRM system (CXL) support would take months. The opportunity was now.
Quick Tips and Tricks :
To support the business opportunity and capture deals, we used Factoryzetm Functions As a service deployed in a secure, datacenter deployed, bare metal, Kubernetes cluster to provide an enterprise-scale production-grade solution in three hours ( discovery, solution design to delivery into production).
The deal payload was packaged as a JSON string conforming to a JSON schema stored in an Apache Schema Registry. This JSON deal is sent to a function deployed using horizontal pod autoscaling to write to the Commodity Logictm database.
The function comprises a handler written in Python ( support for GO, Typescript, and several other languages) that validates and parses JSON payload. Then writes deal to MongoDB collection in the Commodity Logictm document database collection associated with deal type. Subsequently, a message is sent to Apache KAFKA topics, where Commodity Logictm consumers process the deal for risk, compliance, surveillance, positions, near real-time P&L, and other needs.