Book Image

Getting Started with Hazelcast, Second Edition

By : Matthew Johns
Book Image

Getting Started with Hazelcast, Second Edition

By: Matthew Johns

Overview of this book

Table of Contents (19 chapters)
Getting Started with Hazelcast Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Having some of our data everywhere


There are some use cases where certain data that is stored within a cluster is relied upon so heavily, it would be beneficial to have a backup copy on every node. This, combined with enabling the read-backup-data option for the collection, means that we will always serve this data directly from the queried node rather than reaching out from across the cluster. We can achieve this by ensuring that the number of copies was configured to be the same as the number of nodes, but this configuration would immediately degrade the moment we scaled up the cluster.

Fortunately, this use case has been considered for us. ReplicatedMap is a specialized map collection. Rather than partitioning the data and distributing a set number of replicas amongst the available nodes, the data is weakly replicated to all the nodes in the cluster. This makes it best suited for immutable, idempotent, or semi-static data due to the fact that changes will be made on a best efforts basis...