Key-Value Maps

Programs can use maps to store key-value pairs in a persistence store.

A map behaves like a simple database table with two columns: key and value. The key is a string, and the value is a message.

Programs assign a name or destination to each map. A store may contain many maps, each with a unique name or destination.

API methods can do these operations:

  • Create a map.

  • Set a key-value pair or multiple key-value pairs.

  • Get a key's value.

  • Remove a key-value pair.

  • Iterate over all the key-value pairs in a map, or some of the key-value pairs using a string matcher.

  • Close a map object.

  • Delete a map from the store.

In addition, most of these methods are available as locked operations. That is, you can use a lock to ensure that map operations in different processes do not interfere with one another (see Locks).