Any alternative solution to create a SQL table structure in Redis using Redisson in java app. For example a table of say Products.
The standard flow would be to instantiate a RMapCache and add the products to that - something like this
// save the prod to ProdTableCache
final RMapCache<String, Product> prodMap;
String prodMapKey = "ProductTable";
final TypedJsonJacksonCodec prodCodec = new TypedJsonJacksonCodec(String.class, Product.class, new ObjectMapper());
prodMap = redisson.getMapCache(prodMapKey, prodCodec);
Product prod1 = new Product("Prod101", "Mobile", 1000);
Product prod2 = new Product("Prod102", "Tablet", 2000);
prodMap.put(prod1.id, prod1, 2, TimeUnit.DAYS);
prodMap.put(prod2.id, prod2, 2, TimeUnit.DAYS);
and this in Redis would result in something like this
hscan "ProductTable" 0 1) "0" 2) 1) "\"Prod101\"" 2) "\x00\x00\x00\x00\x00\x00\x00\x00-\x00\x00\x00\x00\x00\x00\x00{\"id\":\"Prod101\",\"name\":\"Mobile\",\"price\":1000}" 3) "\"Prod102\"" 4) "\x00\x00\x00\x00\x00\x00\x00\x00-\x00\x00\x00\x00\x00\x00\x00{\"id\":\"Prod102\",\"name\":\"Tablet\",\"price\":2000}"While this solves the immediate problem, 2 or 3 questions arise
If someone has a better solution or better insight into this can you please share. Or am i missing something here?
appreciate your help...