j3k0 / ganomede-usermeta

ganomede's user metadata microservice
0 stars 0 forks source link

Redis Hashes instead of keys #10

Closed elmigranto closed 7 years ago

elmigranto commented 7 years ago

Currenly we use key/values ((m)get, (m)set). Redis hashes suit us better semantically and it's a lot easier to fetch all keys for user, espesially if we have a lot of keys (both are O(N), but for key/value N is number of all keys, and for hashes only in hash, single command).

j3k0 commented 7 years ago

Not urgent / unnecessary:

  1. we need to keep backward compatibility, so this change adds complexity to handle legacy data.
  2. neither of the usermeta redis and ganomede modules use significant amount of CPU so far to justify the optimization. See below, we have quite some margin
screen shot 2017-04-02 at 07 18 14

note, this is ganomede-users:v1.5.11 -- currently in production -- which does handle usermeta so far, until we update the app. So this CPU usage includes handling usermeta as well as all the other stuff ganomede-users is doing