Reputation: 22051
I would like to know if there are any MVC framework compatible with Redis as a database. (Not just as a caching datastore).
Thanks
Upvotes: 1
Views: 806
Reputation: 11570
+1 for Padrino.
Another great option is Monk. It includes Ohm(its actually written by some of the same guys) and is based on Sinatra. Its really easy to get started with and very flexible.
Upvotes: 4
Reputation: 143349
You should definitely check out my C# ServiceStack.Redis Client. The client provides a typed API that can store any type and other high-level functionality, i.e. Strong-typed messaging API, Transactional Support, Pipelining, etc.
Here's is an mini clone of Stack Overflow built with it, using only one page of C#:
Sample Code from Redis StackOverflow:
public User GetOrCreateUser(User user)
{
if (user.DisplayName.IsNullOrEmpty())
throw new ArgumentNullException("DisplayName");
var userIdAliasKey = "id:User:DisplayName:" + user.DisplayName.ToLower();
using (var redis = RedisManager.GetClient())
{
//Get a typed version of redis client that works with <User>
var redisUsers = redis.As<User>();
//Find user by DisplayName if exists
var userKey = redis.GetValue(userIdAliasKey);
if (userKey != null)
return redisUsers.GetValue(userKey);
//Generate Id for New User
if (user.Id == default(long))
user.Id = redisUsers.GetNextSequence();
redisUsers.Store(user);
//Save reference to User key using the DisplayName alias
redis.SetEntry(userIdAliasKey, user.CreateUrn());
return redisUsers.GetById(user.Id);
}
}
Upvotes: 1
Reputation: 26801
grails has redis support in GORM through the redis plugin. Any domain class can be stored in redis (or any one of the other supported nosql stores) instead of a relational database.
Upvotes: 0
Reputation: 15869
In Ruby you can use Ohm as ORM. If you want an MVC framework, it can be plugged to Padrino.
Upvotes: 2
Reputation: 9973
try to investigate cqrs architecture with event sourcing. And you can download example of this from github.it is Ruby on Rails application with Redis DB
Upvotes: 1
Reputation: 43094
I would not expect any MVC framework to be tied to a database. Your implementation of the Model would provide access to whatever backing store (either directly or via one or more layers) was appropriate. You should be looking at the clients that Redis supports, with those you should be able to utilise MVC frameworks on any of the support client platforms.
Upvotes: 3