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 Code Inside Team

Learn more about our team.

Comment on this post

Recent Posts

  • image1825-439x194_thumb.png
    Change the WebDeploy Port or why do I need port 8172?

      If you use WebDeploy on a server operation system you would usually use Port 8172. But what is this Port for and can I change it? Hint: For installing the WebDeploy I recommend this Blogpost. Port 8172 = IIS Management Service Default Port The Port 8172 is the default port of the IIS Management ...

  • Windows Phone Fonts & what if Visual Studio lies

    Today I was confronted with a little Problem: my Windows Phone App refused to show me the Font I choose – also other thinks didn’t work. Although the Visual Studio Designer did show the Fonts: Unfortunately there isn’t much left in the Emulator: Reason for this: Windows Phone doesn’t include all the typos Windows does ...

  • Json-Online-Tools: Viewer & Json2Csharp generator

      Wherever APIs are mentioned the JSON format I not far away. Since I’m using two tools regularly I would like to introduce you to them. JSON Viewer If you only see the JSON-Text you are usually not able to see the structure. With the help of JSON Viewer you can have an easy overview: ...

  • Windows Phone SDK & „System“-Icons

      Although the Metro Design focuses a lot on Typography Icons are still quite important. If you install Windows Phone SDK you will receive 36 Icons. You can find them here: C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Icons Unfortunately many Icons you might know from the common applications are not integrated. Pedro Lamas extracted 99 additional Icons ...

  • image1830-570x194.png
    How can I figure out if my ADFS 2.0 works?

      I was working with ADFS 2.0 (“Active Directory Federation Services”) for a while when this simple question crossed my mind: How can I figure out if the connection between ADFS and AD “works”? Here is a simple test… What is ADFS? If you need some “position of trusts” beneath the AD-boarders you choose an ...

Support us