java - How to save this data into Redis by using Jedis library? -


i new in redis database , need bit help. need store lot of values speciefied key, i'm making punishment system minecraft need store player, playeruuid, staff, reason, time, date, active, unbanned by, unban reason, unban date. there 4 types of punishments(each have separate table): bans, mutes, warnings, blacklists.

one alternative storing data in redis use hash datatype store data. using code like:

try {jedis jedis = pool.getresource()) {     map<string,string> map = new hashmap<string,string>();     map.set("reason", "some reason!");     ...     jedis.hmset("player:" + playeruuid + ":", map); } 

assuming player's uuid best primary identifier. need add additional mappings other lookup keys uuid or whatever primary identifier choose.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -