My server code runs on Dart and is currently using Redis as a data store through redis_client .
Basically, I store primitive data types like integers and strings. However, I also have several business objects, such as User, and ideally I would like to store them in Redis.
Of course, Redis is a key repository, not a complete document database such as MongoDB. So I started writing my own serialization and persistence logic - for example, a simple getter for User:
import 'dart:convert';
...
Future<User> GetUser(String userGuid)
{
var userKey = "userGuid:" + userGuid.toString();
return redisClient.get(userKey).then((String value) {
return new User.fromJSON(value);
});
}
Before proceeding with the processing of all the save logic for all my business entities - is there any Redis / Dart data access package that I should know about, like redis_orm (Ruby) , for example ?
If not, I will probably write my own.
(I don't want to call it ORM, because, well, Redis! = Relational - but what I'm looking for is effective)
source
share