Skip to content
Masselot Antoine edited this page Jan 10, 2019 · 2 revisions

About Spotter API

Architecture

Software/Production Solution: Serverless

In order to gain velocity and anticipate computing/maintaining fees in the futur, we decided to bet on Serverless technology such as AWS Lambda coupled with AWS API Gateway, AWS DynamoDB and AWS S3 in order to focus our efforts on development using the concept of FAAS (Function As A Service).

This allows us to get ready really fast, take advantage of the huge free tier available on Serverless Products. In order to make it easier to manage the code base and map it to computing resources, we are using node.js (TypeScript) version of the Serverless Framework.

Serverless Framework allows us to focus deeply on developing handlers, which will then be mapped to events, from available Cloud Providers (mainly Google Cloud, Amazon Web Services and Microsoft Azure) such as HTTP calls, Object management inside a S3 Bucket, changes inside Document Database Objects.

Many useful packages have been developed by the community in order to make serverless development easier for everyone, we are using the following:

  • serverless-webpack, which allows us to use TypeScript inside our nodejs8 runtime handlers
  • serverless-dynamodb-local: Emulate Amazon DynamoDB and run a local server to start development with
  • serverless-offline: Emulate Amazon API Gateway inside a local server, which allows us to test our endpoints by triggering HTTP Events just like we would in production environment, on AWS.

Integration with CI/CD Tools

We decided to use CircleCI free tier tooling to manage our continuous integration and deployment logic.

CI

All our unit tests will be ran inside pipelines, which only require the code base and the dependencies.

Functional tests will be executed on our development environment (which should be up-to-date) before merging to master branch.

Functional tests in production will be executed after our code base has been updated in production, to make sure that nothing that's been tested in development before is broken in production.

CD

As Serverless Framework abstracts all of the deployment logic in a cloud-agnostic way, we only have to fill in our resource requirements inside a serverless.yml file (S3 buckets, DynamoDB Table definitions, AWS Lambda function and their triggers).

The whole deployment logic is encapsulated inside the serverless deploy command, which we may run inside a CD Pipeline with the right credentials.