Introduction to Redis on Windows & Redis usage with .NET

image1528-570x194_thumb.png

 

Redis belongs to the NoSQL data banks and you will find it in the group of Key-Value Stores. Redis is often named “Blazing Fast” and according to the Stackoverflow Thread it is used to be two time (while writing) and three times (while reading) quicker than MongoDB. Even if the comparison is a little bit unfair (Document data bank vs. Key-Value).

Redis is going to be ported on Windows (and maybe also implemented as an Azure Service)

It isn’t a secret that the Microsoft Open Source department is working on running Redis on Windows at all. A first concept was published last week. Microsoft sheared there results on GitHub – even if there is still a long way to go before the productive use on windows.

Redis as an Azure Service?

 

One of the firs comments is already mentioning Azure:

image

the answer:

image

Let’s take a look when this could be reality: additionally there are already some Redis Hoster.

Getting Redis to run on Windows

Before it will work in the Cloud it should work on our Windows surrounding. At the Moment (May 2012) you need to download this Dev Branch and open the RedisServer.sln with Visual Studio:

image

You need to build the Solution (consisting of C ++ Projects):

image

Depending on your configuration you will receive the msvs\Debug folder or the msvs\Release folder. The folder contains numerous files including the redis-server.exe.

Start the Server

After the Start of the Server you will see the Server Port (a little bit hidden but still there)

SNAGHTMLd00e987

Redis & .NET AKA play around with API

Advance notice: I do not know what to do with Redis it is just pure interest and ludic drive.

image

For demonstration I’ve created a simple MVC project and searched Redis via NuGet:

Service.Stack.Redis – sounds good!

SNAGHTMLd040daa

Democode:

 public ActionResult Index()
        {
            RedisClient client = RedisClientFactory.Instance.CreateRedisClient("localhost",6379);
            client.Add("Test", Guid.NewGuid());

            var result = client.Get<Guid>("Test");

            ViewBag.Message = "Welcome Redis: " + result;

            return View();
        }

E voilà! A GUID:

image

And there is also something going on in the console:

SNAGHTMLd074196

When should I use Redis? What is good? What is bad?

Because I’m not that experienced at the moment I would like to collect the oppinions on KnowYourStack.com: Why should I use Redis? What is good? What is bad?

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

About the author

Written by

Learn more about our team.

Comment on this post

Recent Posts

  • image1929-570x143_thumb.png
    Create and validate own Json-Web-Tokens (JWTs)

    If you are interested in web authentication you probably have heard about JSON Web tokens (JWT). What is a JWT? Maybe I’m not using the correct security termination but however: JWTs are used to exchange claims between two systems. For example: You want to log on to a service (like Facebook, Twitter, etc.) and want […]

  • Micro-Optimization: how to shrink or „embed“ pictures

      I’m currently working on the “CodeInside Dashboard” and since the page structure isn’t that difficult it should be possible to fulfill all of Google Pagespeed or Yahoos YSlow recommendations. One of the rules was to optimize the 4 PNGs that are embedded on the page.   Before – without optimization: Below you can see […]

  • image1979-570x194.png
    Move to Windows Azure – VMs, Word Press Migration, DNS changes

    Since mid January this blogs runs on a WordPress installation in an Azure VM. Because I always thought that the subject is quite complicated this blogpost offers a view behind the scenes. Why this move? So far this blog (both German and English Version) runs on a hoster somewhere in Germany. The main problem with this […]

  • Windows Azure Active Directory – CRUD for users and groups

      Windows Azure Active Directory? If you are not informed about the subject I recommend you to have a look on this Azure Info site. Which resources are there? The Azure AD contains the following entities: - Users - Groups - Contacts - Roles Access to the directory or on the “directory graph” Although the […]

  • Introduction into SignalR 2.0 & Azure Website Websockets

      SignalR is an Open Source Framework for Real Time WebApps. The main problem with Real-Time in the web is the canal between Browser and Server. If you never had to deal with SignalR and this problem before here is a brief introduction:   The problem Traditionally the browser initiates the request to the server […]

Support us