diff --git a/core/store/hz/common/src/main/java/org/onlab/onos/store/common/RoleInfo.java b/core/store/hz/common/src/main/java/org/onlab/onos/store/common/RoleInfo.java
new file mode 100644
index 0000000..904488b
--- /dev/null
+++ b/core/store/hz/common/src/main/java/org/onlab/onos/store/common/RoleInfo.java
@@ -0,0 +1,69 @@
+package org.onlab.onos.store.common;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Objects;
+
+import org.onlab.onos.cluster.NodeId;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * A container for detailed role information for a device,
+ * within the current cluster. Role attributes include current
+ * master and a preference-ordered list of backup nodes.
+ */
+public class RoleInfo {
+    private final NodeId master;
+    private final List<NodeId> backups;
+
+    public RoleInfo(NodeId master, List<NodeId> backups) {
+        this.master = master;
+        this.backups = new LinkedList<>();
+
+        this.backups.addAll(checkNotNull(backups));
+    }
+
+    public NodeId master() {
+        return master;
+    }
+
+    public List<NodeId> backups() {
+        return Collections.unmodifiableList(backups);
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        if (other == null) {
+            return false;
+        }
+        if (!(other instanceof RoleInfo)) {
+            return false;
+        }
+        RoleInfo that = (RoleInfo) other;
+        if (!Objects.equals(this.master, that.master)) {
+            return false;
+        }
+        if (!Objects.equals(this.backups, that.backups)) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(master, backups.hashCode());
+    }
+
+    @Override
+    public String toString() {
+        final StringBuilder builder = new StringBuilder();
+        builder.append("master: \n\t").append(master).append("\n");
+        builder.append("backups: \n");
+        for (NodeId n : backups) {
+            builder.append("\t").append(n).append("\n");
+        }
+        return builder.toString();
+    }
+}
diff --git a/core/store/hz/common/src/test/java/org/onlab/onos/store/common/RoleInfoTest.java b/core/store/hz/common/src/test/java/org/onlab/onos/store/common/RoleInfoTest.java
new file mode 100644
index 0000000..c7e43ff
--- /dev/null
+++ b/core/store/hz/common/src/test/java/org/onlab/onos/store/common/RoleInfoTest.java
@@ -0,0 +1,41 @@
+package org.onlab.onos.store.common;
+
+import java.util.List;
+
+import org.junit.Test;
+import org.onlab.onos.cluster.NodeId;
+
+import com.google.common.collect.Lists;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+
+/**
+ * Test to check behavioral correctness of the RoleInfo structure.
+ */
+public class RoleInfoTest {
+    private static final NodeId N1 = new NodeId("n1");
+    private static final NodeId N2 = new NodeId("n2");
+    private static final NodeId N3 = new NodeId("n3");
+    private static final NodeId N4 = new NodeId("n4");
+
+    private static final List<NodeId> BKUP1 = Lists.newArrayList(N2, N3);
+    private static final List<NodeId> BKUP2 = Lists.newArrayList(N3, N4);
+
+    private static final RoleInfo RI1 = new RoleInfo(N1, BKUP1);
+    private static final RoleInfo RI2 = new RoleInfo(N1, BKUP2);
+    private static final RoleInfo RI3 = new RoleInfo(N2, BKUP1);
+
+    @Test
+    public void basics() {
+        assertEquals("wrong master", new NodeId("n1"), RI1.master());
+        System.out.println(RI1.toString());
+        assertEquals("wrong Backups", RI1.backups(), Lists.newArrayList(N2, N3));
+
+        assertNotEquals("equals() broken", RI1, RI2);
+        assertNotEquals("equals() broken", RI1, RI3);
+
+        List<NodeId> bkup3 = Lists.newArrayList(N3, new NodeId("n4"));
+        assertEquals("equals() broken", new RoleInfo(N1, bkup3), RI2);
+    }
+}
