javachroniclechronicle-map

Use Chronicle Map as a means of data sharing among micro services


In one of my project, we elected to use Chronicle Map as the underlying data structure for storing and sharing data among different microservices across different hosting servers.

Our idea is we use createOrPersist(File file) method to create a Chronicle Map Store and save the persisted file on a network storage, when one of the microservice does PUT operation, the entry will be persisted(synchronised) to the persisted file swiftly, then another micro service can GET the entry later, get PUT and GET operation may be few minutes apart.

Having studied the tutorial, We learnt that the data replication only available in the Chronicle Map Enterprise version, we are using the open source version. Could any one suggest whether the aforementioned approach is realistically doable?

Also If the shared persisted file approach would not achieve what we expected, can we use chronicle map combine with chronicle engine to fulfil the data sharing across microservices?


Solution

  • Chronicle Map works via mapping the entire file into memory. I'm not sure network storage supports mmap at all, but even if it does, my suspicion is that this design will work awfully in terms of performance and replication consistency.

    Also If the shared persisted file approach would not achieve what we expected, can we use chronicle map combine with chronicle engine to fulfil the data sharing across microservices?

    Unless you will to write and support the replication code yourself, realistically I think you have to pay for Chronicle Enterprise there. If you need a battle-tested, open source, community-supported replicated key-value store, something like Redis Cluster might be a better bet, although it's probably less efficient than Chronicle Map.