Helidon
Published in

Helidon

MicroStream + Helidon =
Brave Performance Combination

MicroStream provides high-performance, Java-native object graph persistence.

MicroStream replaces the heavyweight JPA and allows you to store - and partially load- any Java object graph or subgraph. It also provides microsecond response time and ultra-high throughput with minimal latencies. Now you can use MicroStream with Helidon 2.4 to create ultra fast, in-memory database applications and microservices.

MicroStream completely reworked Java’s serialization mechanisms, providing the ability to save partially loaded objects directly to disk, databases, or cloud object stores. Just choose the right Store Manager.

Helidon now has full integration with this technology.

As mentioned above, MicroStream is now fully integrated with Helidon, which means that MicroStream components can read all their configuration directly from Helidon config.

There is a special set of annotations to inject to Storage Manager:

First, add the Maven dependency:

Then you can use the MicroStream support:

The configuration will be read from the microprofile-config.properties file.

In Helidon’s official examples repository, you may find a slightly modified Greeting example. The main modification is adding a persistence to the set of “Greetings” you add. This means that if you add a new greeting, and restart the application, the set of them will not be lost.

You can try it for yourself with this example: https://github.com/oracle/helidon/tree/master/examples/integrations/microstream/greetings-mp

The exact same functionality is provided in Helidon SE. You can use EmbeddedStorageManagerBuilderto initialize the MicroStream Storage Manager. All the configuration is taken from the Helidon Config:

As you see, all the operations with MicroStream are asynchronous and reactive.

Persisting an object is also simplified:

Try it! You can access the Helidon SE + MicroStream example in our official repository: https://github.com/oracle/helidon/tree/master/examples/integrations/microstream/greetings-se

Full integration includes also provide health checks and metrics support. Because Helidon is modular, you need to add a Maven dependency in order to read health checks:

and then for Helidon SE you should just register it:

The same method is used for metrics.

First, add the Maven dependency:

then, by using MicrostreamMetricsSupportobject, you can register a StorageManager:

Now all the health and metrics information is available under /health and /metrics endpoints of Helidon.

MicroStream provides its own implementation of JSR107 — Caching Support.

It is available when you add this Maven dependency:

Then we can modify our Greetings application to use cache for our greeting:

There is a special @MicrostreamCache annotation that will read all the caching configuration from microprofile-config.properties:

As you see, it‘s that easy!

MicroStream is a real game changer in the industry. If you want to create really performant microservices, to work in really high-pressure environments, then Helidon + MicroStream is a really great choice! Not only is it easy to set up and use, but now its fully integrated.

Kudos to MicroStream team!

More info: http://microstream.one

--

--

The official project Helidon blog containing articles from Helidon developers and the developers community. All articles are approved by the Helidon team. Contact @dkornilov to publish your story.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store