3 ms·
> I understand the dislike for using in-memory databases as a json store (by reading/writing entire objects at once), but if you're using Redis this way, you're
by turdnagel 7y ago
> I understand the dislike for using in-memory databases as a json store (by reading/writing entire objects at once), but if you're using Redis this way, you're doing it wrong.
I guess... is it so terrible to use a dictionary/hash-type data structure with values more than one level deep? Redis doesn't provide a data structure for that.
- kristoff_it 7y agoI think in the paper they are talking about serializing the entire object as a single string key that needs to be loaded and written all at once even to do simple things. Nested data structures are definitely going to be better than that but they also do have some caveats. If you really want to nest arbitrarily, take a look at RedisJSON, but I would recommend to stick with vanilla structs as much as you can. More often than not you can quench your thirst for nesting by good use of key prefixes.
- sitkack 7y ago> Redis doesn't provide a data structure for that. Both Redis and Aerospike provide more than enough mechanisms for one to roll their own composite hierarchy. Both provide server side scripting via Lua as well so the database can maintain consistency and prevent chatty access to the store. KV database modeling is just as rich as its relational counterpart, but if one isn't using a KV store for a compelling reason, use Postgres. https://www.aerospike.com/docs/guide/data-types.html https://www.aerospike.com/docs/guide/data-types.html https://www.aerospike.com/docs/guide/udf.html https://www.aerospike.com/docs/guide/udf.html