Welcome to MirrorMap. MirrorMap is a replicating Java map implementation. Its key features are:

A MirrorMap wraps any standard Java map implementation and decorates it with the ability to replicate changes with other remote MirrorMap instances. A MirrorMap is given a name, replication occurs with remote instances of the same name. Both the map key and value need to implement the Serializable interface.

MirrorMap is built on top of a NotifyingMap; this is a Map implementation that has the ability to notify observer objects when map entries are added, updated or removed. The operations to the map are further categorised into a 'before' and 'after' events e.g. when adding an entry to a NotifyingMap, observers receive a 'will add' notification, the entry is added, then the observers receive a 'did add' notification. A similar for pattern follows for update and remove operations.

Logically, replication is peer-to-peer. Physically, all peer communication is done using a server component. The server holds the master copy of the named MirrorMap. New peers register with the server for replication and will receive the full map image upon registration. The connection with the server is point-to-point using TCP; the server performs the fan out of changes to all peers. Note that MirrorMap is written using the Java NIO library.

The diagram below illustrates the topology.

MirrorMap topology

MirrorMap is not a cache framework (like Ehcache), nor is it a distributed map (like Hazelcast), its simply a replicating map.

Please refer to the tutorial and Javadoc for further information.