A Serverless Music Sync App

For one of our clients we were asked to supply a small team of experts to build a bespoke music sync application. The application would (very briefly)

In addition we determined that the application should

How we did it

We scripted the infrastructure-as-code using a combination of Terraform (for the persistent resources such as databases, shared IAM policies, shared API gateway, etc.), and Serverless Framework for the individual micro-services.

The code was laid out in a mono-repo.

For full-text search we chose the AWS offering of Elastic Search.

We ensured the Elasticsearch-index would be kept in sync with the database by utilising an architecture where an AWS Aurora trigger would send data to a lambda which would, via an SNS & SQS, trigger a lambda which in turn populated the index.

Application logs are automatically sent to Cloudwatch Logs when using AWS Lambda. To then stream them to ELK we utilized Cloudwatch Logs Subscription Filters.

The micro-services architecture we applied utilised what we called a "middle layer", responsible for keeping state such as sessions. The layer also maintains a cache layer (using AWS Redis) to cache calls to the micro-services, which mostly consisted of basic CRUD operations. The layer also allowed for aggregation of requests to the underlying layer of micro-services.

The API used a combination of REST & GraphQL.