Serverless functions are not just technology, but also a mindset, says Vikas Raina of Oracle
While the name “serverless” implies a lack of servers, it is important to remember that servers are definitely involved in serverless technology, clarified Vikas Raina, Chief Architect and Development Advocate, Oracle for Startups.
In a masterclass on the modern cloud at TechSparks 2021, Vikas explained that in serverless technology, there is no need for an infrastructure setup. This means that as a developer, one doesn’t need to care about the infrastructure and they can run their code as is available to them.
All the compute resources are provided by the cloud service provider, which means the provisioning, maintenance, configuration and security of the infrastructure is no longer the developer’s responsibility.
“As a developer, you focus on building your application and not the infrastructure,” Vikas said.
Advantages of serverless technology
One of the most common problems when it comes to storage is the ratio of capacity to usage. This happens quite often when websites crash after usage sees a huge spike, causing losses to the business.
In such a case, companies typically buy excess capacity. But excess capacity means that some capacity is idle if you are paying for something which you're not really using, or using for a very limited amount of time. These are the situations that can be solved by the modern cloud.
Vikas said, “In serverless, your capacity is exactly as for the usage, nothing more, nothing less. Capacity increases as your usage increases and capacity decreases as your usage decreases, which means potentially, you can have your capacity going from zero to infinity and coming back to infinity. So, auto-scaling happens as a key feature of serverless. Whereas in the native cloud, whether you're using bare metal or you're using virtual machines or containers, capacity can be an issue,”
The features of serverless include:
- Serverless storage
- Serverless database
- API Gateway
FaaS, or function-as-a-service, is a subset of serverless and one of its most important features. It inherits all the features of serverless. Typically, it's a single function that is being invoked and executed. Functions are typically run in specialised stateless container service. And functions are invoked either through API's or through event-driven architecture.
For example, take the case of a ticketing portal, where you go and book your tickets. Once you book the tickets, the database gets updated with all the information that has been captured. Once the information gets captured in the database, that function is triggered.
Once this function is triggered, it would collect all the information from the database about the messenger and the itinerary and send an email confirmation. Once this confirmation is sent, the job function is over. And that’s the end of the whole process.
The same process can be seen in serverless API gateways. “Your gateway would be a kind of HTTP server, where you will have your request coming in. You would have the endpoints and routes defined associated with the resource. And once the request comes in, that request is sent to the function which gets invoked at that point in time. And function does the job, which could be actually interacting with the database, fetching the information or loading information to a database. It will then send the results back to the API gateway, the API gateway would again reformulate the response in HTTP format and send it back to the calling program or the client. In this case, the services are invoked only when they are called upon. And once the job is done, the services go down to zero level which means again, there is no payment, there is no billing and there is no maintenance for the end-users,” Vikas explained.
Charm of FaaS
- Infrastructure cost reduces dramatically
- Provisioning is lightning fast
- Focus on development
- Highly scalable
- Reduced up-front costs
- Maintenance tasks outsourced
According to Vikas, serverless functions are not just technology, but also a mindset. One needs to understand where, when and how to use these functions.
“So depending on what kind of business case you have, you could pick any popular cloud service provider and start using either serverless resources like storage or messaging queues or database, or you could use Functions as a Service from your cloud service provider. It is the future, everybody is moving towards serverless functions or serverless architecture. So, there are many companies that provide or are coming up with new features as far as serverless platforms are concerned,” Vikas signed off.
To log in to our virtual events platform and experience TechSparks 2021 with thousands of other startup-tech enthusiasts from around the world, join here. Don't forget to tag #TechSparks2021 when you share your experience, learnings and favourite moments from TechSparks 2021.
For a line-up of all the action-packed sessions at YourStory's flagship startup-tech conference, check out TechSparks 2021 website.