Alleviating continuous headaches

When it comes to managing many functions we have taken the approach of breaking things up into distinct business domains and each domain is essnetially a single Serverless service. For example, Customer data management is a single service which has exposed API’s for receiving new customer data, editing it, allowing API calls to retrieve it as well as event based functions to add customer to mailing list if appropriate, log all interaction CRM-wise, etc. This way if we need to make a change to something related to “Customer” its only one service that needs updating and deploying.

Speaking of which, we also currently use Bitbucket for SCM and with that comes Pipelines whcih we use for our CI/CD, well, pipeline. This allows us to, as soon code is pushed into the repo, run all our tests and if they pass run sls deploy to then have all changes automatically pushed live. As a part of our process, developers run their tests locally (using a combination of serverless plugins to run offline and that wrap Lambda functions for unit testing purposes), they then push their code at the develop branch which runs our HTTP integration tests (a very limited number) as well as the unit tests again before the code being accepted by me into the master branch which then automatically goes live.

Doing things this way we don’t really care how long it takes to go live because we can test all code offline and not have to worry about deployments. Any communication between services is done over HTTP and a RESTful architecture.