Simulate the System

how-to

by Christian Clausen

on Jun 29, 2025 (created Dec 3, 2024) • 2 min

How the Simulator Works

Merrymake CLI allows us to simulate either part of or our entire system. This means we can experiment with changes without deploying them. We can even make changes in many services, and get a good idea of how our system would behave in production. The simulator even works without internet.

The simulator detects folders with a merrymake.json file. It runs the services directly on our machine. The simulation includes all the services we have on our machine. We can exclude services by deleting the repository folder. We can make changes to services without restarting the simulator.

Run the Simulator

To start the simulator use this command anywhere in an organization:

$ mm sim

Important: The simulator does not automatically build services. Make sure the services you trigger are up-to-date with mm build.

We can verify that the simulator is ready by going to http://localhost:3000/ in a browser where we should see:

Simulator ready.

We can trigger services by sending requests to http://localhost:3000/[EVENT] with a browser or Postman. The simulator prints logs from our services. It prints which trace id and repository the logs came from. It also prints other helpful information, such as:

Use Environment Variables

We don't want to use our production data stores when testing locally. Thus, we put our data store configuration in environment variables. Then, we can add a env.kv file in a service group folder. This is a key-value file where each line should look like:

back-end/env.kv
KEY=value

This allows us to define different configuration for services in different groups. Even when the services use identically named environment variables.

Conclusion

The simulator provides an almost identical experience to the platform. The message flow is the same. The HTTP trigger work the same. The performance is different. The local simulator does not perform any optimizations on our services. The simulator can show whether our services function correctly. It cannot expose performance issues.

Christian Clausen
Dec 3, 2024