Synthetics is a testing technique born in the crucible of cloud software engineering. In this blog post, we will review what role synthetics play, and how to exploit them to full advantage.

Microservices modularize the functionality built by the organization. An API call on the cloud service typically results in multiple microservices being called to fulfill a given request.

Microservice architecture also provides capability to change a single service in isolation with other services. Continuous Integration (CI) describes a process to build a new version of the microservice. Continuous Deployment (CD), describes the process used to replace an existing version of the software with a new version.

Synthetics is a part of CD, and done right:

  • simplifies both CI and CD
  • increases confidence in quality of the software

Synthetics is a program to monitor success and or failure of user transactions that originate from a given microservice. Synthetics help engineers on the team feel confident that their software is behaving as it should.

The reason synthetics are more useful as opposed to traditional approaches (like unit or integration testing) is because microservices change all the time, and there is no *snapshot that can exhaustively be tested and validated. Synthetics can also be used to isolate effects of intermittent failures.

A typical synthetics program records microservice version, requests and responses into a metrics system like prometheus/ signal-fx. As part of CD process, the team:

  • runs on demand synthetics on their new microservice
  • verifies that the synthetics metrics are succesful
  • proceeds to replace existing software version with the new one