Lets say I have a hash of a hash e.g.
$data = { 'harry' : { 'age' : 25, 'weight' : 75, }, 'sally' : { 'age' : 25, 'weight' : 75, } }
Redis has many use cases for big data scenarios – primarily advanced by its extreme performance, simplicity and above all, versatility. High-Speed Data Ingest: Big data is characterized by its volume, variety and velocity.
We use various data structures (linked lists, arrays, hashes, etc) in our applications.
Redis lacks dedicated data types for geospatial objects. Instead, points are stored in sorted sets. The scores of the sets are used for encoding coordinate pairs.
What would the 'usual' way to store such a data structure (or would you not?)
For example harry and sally would be stored each in separate hashes where fields would represent their properties like age and weight. Then set structure would hold all the members (harry, sally, ...) which you have stored in redis.
Would you be able to directly get a value (e.g. get harry : age ?)
Yes, see HGET or HMGET or HGETALL.
Once stored could you directly change the value of a sub key (e.g. sally : weight = 100)
Yes, see HSET.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With