I am new in redis database and I need a bit help. I need to store lot of values to speciefied key, I'm making a punishment system for Minecraft so I need to store Player, PlayerUUID, Staff, Reason, Time, Date, Active, Unbanned by, Unban reason, Unban Date. There are 4 types of punishments(each will have separate table): Bans, Mutes, Warnings, Blacklists.
Asked
Active
Viewed 1,017 times
-4
-
OK. What have you tried so far and what stopped you? – M. Prokhorov Sep 12 '17 at 15:44
-
Just reasiled that redis is Key-Value database and its very unefficient to store these data into it. – Ján Kluka Sep 12 '17 at 15:48
1 Answers
1
One alternative for storing the data in Redis is to use the Hash datatype to store your 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 the player's UUID is the best primary identifier. You will likely need to add additional mappings for other lookup keys to the UUID or whatever primary identifier you choose.

Tague Griffith
- 3,963
- 2
- 20
- 24