REST Service

First of all we have to connect a storage to a REST service.

Just add the REST service implementation to your dependencies, the logger is optional.


Now use the resolver to connect the service to a storage, start it, and you’re good to go.

EmbeddedStorageManager storage = EmbeddedStorage.start();
if(storage.root() == null)
	storage.setRoot(new Object[] {,
		X.List("a", "b", "c"),

// create the REST service
StorageRestService service = StorageRestServiceResolver.resolve(storage);

// and start it

That’s all you have to do to open the REST endpoints to access the storage data.

The base URL of the opened endpoints is per default: http://localhost:4567/microstream/

Internally, there is a REST adapter which opens access to the low-level storage data. This is used by the REST service layer, which is an abstract service interface. The default implementation of it, which uses Sparkjava, is used to open the REST endpoints. We just have to use this one to get started.


If you want to change the default port (4567) or instance name (microstream) it can be done by using the rest service implementation directly. The spark service can then be customized by your liking.

StorageRestServiceSparkJava service = StorageRestServiceSparkJava.New(storage);

This will change the base URL to http://localhost/my-name/