Amiqus and the quest for serverless

The importance of IT infrastructure at scale

Amiqus
Amiqus
4 min readApr 12, 2019

--

When your business and its products gain traction, with big orders from big clients, it can be all too easy to get distracted by new hires, product pipelines and branding revamps. As a result, too many companies on the rise neglect to plan for the impact increased traffic will have on their IT infrastructure. Yet, there are few things more frustrating as a customer than discovering the company or product you’ve been looking for all this time, only to have their website crash as they process your order. Some may argue that there is no harm in a little downtime, but how many times would you be willing to input your credit card details when no confirmation email is forthcoming?

At Amiqus, uptime is about trust, one of our core values as a business. As we scale, we need to ensure our platform performs as well at running 20,000 checks per day as it does running 200, which is why the Amiqus team has embraced serverless.

The tech

Serverless is a bit of a buzzword within the tech community. Everywhere you look there’s a blog post — hi — or a talk on using Kubernetes, Docker or Lambda, but what does serverless really mean? The idea behind serverless infrastructure is to focus on your code as a means of managing as few servers as possible, on premise or in the cloud, with the result of minimising infrastructure management and upkeep.

But if there are no servers, how are things being run you ask? Good question. Well, there are still servers in the background, but it’s up to your cloud provider (AWS in our case) to ensure those servers are always available and able to handle increased workload; adding new servers into the mix if things start to struggle.

The practicalities

Since hiring a full-time DevOps Engineer in January, we’ve been hard at work to use serverless in as many upcoming projects as possible. The most visible example will be a new website using AWS technologies (coming soon), which will run on a near fully serverless environment (see infrastructure diagram below).

In a little more detail

A managed RDS instance is used for persistent storage of the Wordpress backend. AWS ECS Fargate is used to handle our backend Wordpress Docker containers. These containers expose an API that the frontend can use to render the website and they read/write to the managed RDS instance. AWS S3 is used to store website cache, as long as S3 is up then a version of our website will be too. Finally, serverless Lambdas are used to route traffic around the website. Every time a user makes a request to the website a Lambda is initiated and it responds with the correct S3 cache contents and displays this to the user.

Now, not only is the above almost fully serverless, but it’s also built using a methodology called infrastructure as code utilising Hashicorp’s Terraform, which we’ll tell you more about in a future blog.

The benefits

There are many benefits to running a fully serverless environment, but for Amiqus there are two key factors, cost and scalability. In terms of cost, by running serverless we essentially only pay for requests made. We pay a set cost for our RDS and ECS containers, but beyond this we only pay for Lambda Invocations, meaning we only pay when someone actually hits the website.

In terms of scale, serverless infrastructure removes the need to start up new servers if our traffic increases. Lambda can scale as fast as Amazon can put out new features, processing literally millions of requests without breaking a sweat. On the off chance that things do get a little too much for our backend containers, then there are scaling policies to ensure new containers come online as demand increases. Fargate as a managed service starts as many containers as needed with the exact version of our code and Amazon does all the heavy lifting for us.

What’s next?

As we continue to grow and make use of upcoming technologies like serverless, you can expect more blogs from the Amiqus engineering team. Next up is how we use infrastructure as code to reliably deploy and maintain our cloud infrastructure.

Kieran McEniff is a DevOps Engineer at Amiqus

--

--

Amiqus
Amiqus

Building tools that make civil justice available to everyone • https://amiqus.co/