Generating Sequence Numbers in Serverless via API Gateway
For many of us moving to serverless from traditional applications, finding an easy way to generate sequence numbers may be puzzling.
Traditionally, relational database systems (RDBMS) such as Oracle provided this out of the box, or custom applications written in favorable languages supplied them in abundance. So, it was never an issue that made us worry.
However, when we land on serverless shores, things aren’t easily visible unless we know the right approach and tools. In serverless, using RDBMS for this purpose is rare, especially when the functions are outside of the VPC (virtual private cloud) boundaries. In addition, we have the statelessness of the functions to deal with.
In this brief write-up, we will explore a common approach to generate sequence numbers while working with serverless applications on AWS.
Use of sequence numbers
If you are new to sequence numbering, let us start with a quick introduction. If you have seen all this before, please skip to the sections below.
In an e-commerce application, we generate order numbers, which are mainly in a sequence. In a college candidate registration system, application numbers can be arranged in ascending order. Another use case is a website's visitor…