Redis Information - Grissess/sdnd16 GitHub Wiki
Resources for using redis and go
- to learn more about redis: try.redis.io
- to get an overview of redis with go: sendgrid.com/blog/get-going-go-redis
- to learn more about the go redis client: github.com/garyburd/redigo
How do we use redis?
We use redis' hashmap data structure to store information about a given network topology after computing the shortest path between all pairs of nodes. Each path (and its length) is stored in the hashmap by the key {s:d} where s means number of the source node, and d which means the destination node number paths are stored as a string in the format "s 1 2 3 ... d | l" where s and d are source and destination node numbers and 1 2 3 ... indicate the path taken between the two, l is the length of this path (length being the sum of the weights of each edge).
All storage and retrieval of information for a given topology is accomplished through simple calls with HSET and HGET.
Information about all of the topologies in a given database is stored in a redis set named {topologies} entries in this set are topologies present in this database. This list is kept up to date when adding and removing topologies from a database through supported means (our Routes Controlling application).