Skip to content
  • Products
    • Persistence for Java / JVM
    • Persistence for Android
    • MicroStream Cluster
    • Serializer
  • Community
    • GitHub
    • Discussion
    • Contribute
    • Issues
    • StackOverflow
  • Resources
    • Get Started
    • Docs
    • Examples
    • Videos
    • Blog
    • Release & Update Plan
  • Services
    • Support
    • Training
  • Company
    • About us
    • Contact
  • Subscribe to our Newsletter
  • User icon Sign in

Cookie

We use cookies to make it easier to use and to further improve our service.

If you have given us your consent, you can revoke it at any time in the data protection declaration.

Use all cookies Manage cookies Reject cookies

Cookie

?
?
?
Use all cookiesSave settingsReject cookiesView Privacy Policy

Necessary

Necessary cookies help make a website usable by enabling basic functions such as page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

Name Anbieter Zweck Ablauf Typ
c3kie_removeCookieWindow microstream.one Saves the consent status of the user whether the cookie window should be displayed. 1 Jahr HTML Local Storage
c3kie_googleAnalytics microstream.one Saves the consent status of the user as to whether Google Analytics is allowed to run. 1 Jahr HTML Local Storage
c3kie_googleAnalytics microstream.one Saves the consent status of the user as to whether Google Analytics is allowed to run. 1 Jahr HTML Local Storage
c3kie_tagManager microstream.one Saves the consent status of the user as to whether Google Tag Manager is allowed to run. 1 Jahr HTML Local Storage
c3kie_facebook microstream.one Saves the consent status of the user as to whether Facebook is allowed to run. 1 Jahr HTML Local Storage
c3kie_matomo microstream.one Saves the consent status of the user as to whether Matomo is allowed to run. 1 Jahr HTML Local Storage
c3kie_youtube microstream.one Saves the consent status of the user as to whether YouTube is allowed to run. 1 Jahr HTML Local Storage

Statistics

Statistics cookies help website owners understand how visitors interact with websites by collecting and reporting information anonymously.

Name Anbieter Zweck Ablauf Typ
_dc_gtm_ Google Used by Google Analytics to limit the request rate. 1 Jahr HTTP Cookie
_gid_ Google Registers a unique ID that is used to generate statistical data on how the visitor uses the website. 2 Jahre HTTP Cookie
_gcl_au Google Used to send data to Google Analytics about the device and visitor behavior. Captures the visitor across devices and marketing channels. Session Pixel Tracker
_gat_ Google Used to store a unique user ID. 1 Tag HTTP Cookie
_gat_gtag_UA_ Google Used to store a unique user ID. 1 Tag HTTP Cookie
yt-player-headers-readable YouTube Used to determine the optimal video quality based on the visitor's device and network settings. Persistent HTML Local Storage

Marketing

Marketing cookies are used to track visitors across websites. The intent is to show ads that are relevant and engaging to the individual user, making them more valuable to publishers and third party advertising providers.

Name Anbieter Zweck Ablauf Typ
VISITOR_INFO1_LIVE YouTube Tries to estimate the range of users on pages with built-in YouTube videos. 179 Tage HTTP Cookie
YSC YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Session HTTP Cookie
yt.innertube::nextId YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Persistent HTML Local Storage
yt.innertube::requests YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Persistent HTML Local Storage
ytidb::LAST_RESULT_ENTRY_KEY YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-cast-available YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-cast-installed YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-connected-devices YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-device-id YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-fast-check-period YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-session-app YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-session-name YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage

MicroStream with Helidon MP

Nov172022
Blog

Helidon is a collection of Java libraries for writing microservices that run on a fast web core powered by Netty. The Helidon MP variant includes the MicroProfile specifications and programming against it feels familiar for enterprise java developers as all standard Jakarta EE APIs are available.
There exists also the Helidon SE variant which is a group of reactive, non-blocking microframeworks.

MicroStream is integrated with Helidon, which means that you can add MicroStream and the integration code by adding some Helidon-provided dependencies. It is integrated within the Helidon SE variant but some operations within MicroStream are blocking. So it might not be the best combination since we need to protect a single resource, your database, that is accessed by multiple threads concurrently.

This blog describes how you can make use of the integration with Helidon MP.

Create project

Creating a Helidon MP project can be done in two ways. You can either use the Helidon Starter webpage or from the Helidon CLI with helidon init command to create a basic project structure using Helidon MP.

Once you have the project, you can add the MicroStream integration code by adding the following dependency.

        <dependency>
            <groupId>io.helidon.integrations.microstream</groupId>
            <artifactId>helidon-integrations-microstream-cdi</artifactId>
        </dependency>

Configuration

As a minimum, you need to define the directory where the MicroStream serialisation process writes the binary data. This is done by defining the configuration values using the MicroProfile Config support. This means it can be done by adding the values in the META-INF/microprofile-config.properties file, or any other source supported by MicroProfile Config.

The key values are described on the MicroStream documentation page. And these keys should be prefixed to indicate a certain StorageManager. Since you can define and use multiple StorageManagers for your application, the groups and discriminate the configuration values for each StorageManager.

one.microstream.bookstore.storage-directory=microstream-data

When defining the above value, you set the storage directory configuration value of the StorageManager that you identify with one.microstream.bookstore.

Define Root

Besides the configuration values for the StorageManager, defining the root object of your Object graph is another important requirement for your application.

You can define this easily using a CDI producer that you define within your code. At this central location, you can get hold of the defined StorageManager by the integration code, and define a Root object. And in the same time expose this as a CDI bean so that you can inject it into any other CDI bean within your application, just as you can use the StorageManager.

@ApplicationScoped
public class RootProducer {

    @Inject
    @MicrostreamStorage(configNode = "one.microstream.bookstore")
    private EmbeddedStorageManager storageManager;

    @Produces
    public Root produceInitializedRoot() {
        Root root = (Root) storageManager.root();
        if (root == null) {
           // Define and initialise root with StorageManager.
        } else {
            root.setStorageManager(storageManager);
        }
        return root;
    }
}

 

Health and Metrics

The MicroProfile Health and Metrics specifications are two important aspects that help to increase the observability of your application. The MicroStream integration within Helidon comes with artefacts that provide some specific functionality for MicroStream.

First, you need to add some dependencies to your project.

    <dependency>
        <groupId>io.helidon.integrations.microstream</groupId>
        <artifactId>helidon-integrations-microstream-health</artifactId>
    </dependency>

    <dependency>
        <groupId>io.helidon.integrations.microstream</groupId>
        <artifactId>helidon-integrations-microstream-metrics</artifactId>
    </dependency>

These dependencies contain the basic functionality related to Heath and Metrics that are also useable with Helidon SE. So we need to define the ‘glue’ code that makes the Health Checks and Metrics available through the MicroProfile Specifications.

For the Health checks, we can define the CDI bean implementing the HealthCheck interface and forward the implementation to the MicrostreamHealthCheck code.

@ApplicationScoped
@Liveness
public class MicroStreamHealth implements HealthCheck {

    @Inject
    @MicrostreamStorage(configNode = "one.microstream.storage.bookstore")
    private EmbeddedStorageManager storageManager;

    @Override
    public HealthCheckResponse call() {
        return MicrostreamHealthCheck.create(storageManager)
                .call();
    }
}

 

The check is UP when the StorageManager is running.

For the Metrics support, we can register the MicroStream metrics, like the size of the binary data that is stored, when the application starts up. When the metrics are registered, they are called whenever a metrics request is made.

@ApplicationScoped
public class MicroStreamMetrics {

    @Inject
    @MicrostreamStorage(configNode = "one.microstream.storage.bookstore")
    private EmbeddedStorageManager storageManager;

    public void onStart(@Observes @Initialized(ApplicationScoped.class) Object pointless) {
        RegistryFactory metricsRegistry = RegistryFactory.getInstance();

        MicrostreamMetricsSupport microstreamMetrics = MicrostreamMetricsSupport
                .builder(storageManager)
                .registryFactory(metricsRegistry)
                .build();

        microstreamMetrics.registerMetrics();
    }
}

Example

For a demo application, have a look at the repository on GitHub. It has a folder called integrated that contains a demo application using Helidon MP and the integrated MicroStream code.

It demonstrates the configuration as discussed in this text and provides a few endpoints to query, update and insert some data.

Conclusion

With the integration into Helidon MP, it becomes easy to define and configure the StorageManager and the Root object in a central location. From that point onward, they are available as CDI beans and can be used throughout the application to read and store the data from your Object Graph.

 

Category: BlogNovember 17, 2022Leave a comment
Tags: HeldionIntegrationMicroStream

Author: Rudy De Busscher

Post navigation

PreviousPrevious post:Store State of a Background process with MicroStreamNextNext post:Some Data Model considerations for searching and indexing with MicroStream

Related Posts

Two important updates in MicroStream 8.1
June 1, 2023
Quarkus Extension for MicroStream
May 22, 2023
New Features of MicroStream version 8.0
April 28, 2023
MicroStream 8.0 is Now Available
April 26, 2023
MicroStream Becomes an Eclipse Project
April 10, 2023
Blog title MicroStream vs JPA - the ultimate speed test
MicroStream vs JPA and SQL: The Ultimate Performance Test
April 5, 2023

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Post comment

Search
Categories
  • Blog(49)
  • CloudNotification(1)
  • Conferences(13)
  • General(3)
  • News(21)
  • Performance(2)
  • Releases(15)
  • Training(4)
Related Posts
  • Two important updates in MicroStream 8.1
    June 1, 2023
  • Quarkus Extension for MicroStream
    May 22, 2023
  • New Features of MicroStream version 8.0
    April 28, 2023
  • MicroStream 8.0 is Now Available
    April 26, 2023
  • MicroStream Becomes an Eclipse Project
    April 10, 2023
  • Blog title MicroStream vs JPA - the ultimate speed test
    MicroStream vs JPA and SQL: The Ultimate Performance Test
    April 5, 2023
  • MicroStream training in 2023
    March 28, 2023
  • May 16 – 17:00 – 21:00 CEST MicroStream Advanced Course Part 2
    March 13, 2023
  • May 9 – 17:00 – 21:00 CEST MicroStream Advanced Course Part 1
    March 13, 2023
  • April 26 – 17:00 – 21:00 CEST MicroStream Fundamentals Course
    March 13, 2023
Tags
Android AWS Cache Cloud connector Cluster Communication Conference Data Persistence eclipse event feature framework free fundamentals Hackathon Heldion How to InfoQ Integration Java JCON logging LTS Micronaut MicroProfile Microservices MicroStream MicroStream 2 MicroStream 4 MicroStream Day New Features online Open Liberty Open Source Oracle Performance persistence Quarkus release Serialization serializer Spring Boot Subscription Support Training
MicroStream

Store Java Object Graphs natively, relieved of heavy-weight DBMS Dependencies. Create ultra-fast In- Memory Database Applications & Microservices with Pure Java. The Pure Java Paradigm Shift in Database Development.

Upcoming Event

April 19, 2023 | 17:00 – 21:00 CEST
Read more

Platforms

  • MicroStream for Java / JVM
  • MicroStream for Android

Community

  • GitHub
  • Discussion
  • Contribute
  • Issues
  • StackOverflow
  • MeetUp

Resources

  • Get Started
  • Docs
  • Examples
  • Videos
  • Blog
  • Release plan

Services

  • Support
  • Training

Company

  • About us
  • Contact

Stay Connected

  • Twitter
  • LinkedIn
  • YouTube
  • GitHub
  • StackOverflow
  • MeetUp

Get the latest MicroStream news:

Subscribe

© 2023 MicroStream Software. All rights reserved.
  • Terms of use
  • Privacy
  • Legal notice

Cookie

We use cookies to make it easier to use and to further improve our service.

If you have given us your consent, you can revoke it at any time in the data protection declaration.

Use all cookies Manage cookies Reject cookies

Cookie

?
?
?
Use all cookiesSave settingsReject cookiesView Privacy Policy

Necessary

Necessary cookies help make a website usable by enabling basic functions such as page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

Name Anbieter Zweck Ablauf Typ
c3kie_removeCookieWindow microstream.one Saves the consent status of the user whether the cookie window should be displayed. 1 Jahr HTML Local Storage
c3kie_googleAnalytics microstream.one Saves the consent status of the user as to whether Google Analytics is allowed to run. 1 Jahr HTML Local Storage
c3kie_googleAnalytics microstream.one Saves the consent status of the user as to whether Google Analytics is allowed to run. 1 Jahr HTML Local Storage
c3kie_tagManager microstream.one Saves the consent status of the user as to whether Google Tag Manager is allowed to run. 1 Jahr HTML Local Storage
c3kie_facebook microstream.one Saves the consent status of the user as to whether Facebook is allowed to run. 1 Jahr HTML Local Storage
c3kie_matomo microstream.one Saves the consent status of the user as to whether Matomo is allowed to run. 1 Jahr HTML Local Storage
c3kie_youtube microstream.one Saves the consent status of the user as to whether YouTube is allowed to run. 1 Jahr HTML Local Storage

Statistics

Statistics cookies help website owners understand how visitors interact with websites by collecting and reporting information anonymously.

Name Anbieter Zweck Ablauf Typ
_dc_gtm_ Google Used by Google Analytics to limit the request rate. 1 Jahr HTTP Cookie
_gid_ Google Registers a unique ID that is used to generate statistical data on how the visitor uses the website. 2 Jahre HTTP Cookie
_gcl_au Google Used to send data to Google Analytics about the device and visitor behavior. Captures the visitor across devices and marketing channels. Session Pixel Tracker
_gat_ Google Used to store a unique user ID. 1 Tag HTTP Cookie
_gat_gtag_UA_ Google Used to store a unique user ID. 1 Tag HTTP Cookie
yt-player-headers-readable YouTube Used to determine the optimal video quality based on the visitor's device and network settings. Persistent HTML Local Storage

Marketing

Marketing cookies are used to track visitors across websites. The intent is to show ads that are relevant and engaging to the individual user, making them more valuable to publishers and third party advertising providers.

Name Anbieter Zweck Ablauf Typ
VISITOR_INFO1_LIVE YouTube Tries to estimate the range of users on pages with built-in YouTube videos. 179 Tage HTTP Cookie
YSC YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Session HTTP Cookie
yt.innertube::nextId YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Persistent HTML Local Storage
yt.innertube::requests YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Persistent HTML Local Storage
ytidb::LAST_RESULT_ENTRY_KEY YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-cast-available YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-cast-installed YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-connected-devices YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-device-id YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-fast-check-period YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-session-app YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-session-name YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage