ThinkingCog

Articles written by Parakh Singhal

Running Redis in 32 bit Windows

Key Takeaway:

Redis started its life in Linux environment and to this date, it is officially supported only in Linux environment. However, the good folks at Microsoft had started a new division with the sole purpose of porting such useful products to Windows environment and let developers use them with confidence and with the support of Microsoft behind them. Even though that division has now merged back into Microsoft, engineers at Microsoft continue to make contributions to ported projects.

With the 64 bit architecture becoming the de-facto standard in commodity computers, open source contributors and organizations around the world have started to focus on releasing binaries for 64 bit architectures. That leaves people like me who are living perfectly fine life with their old trusty computers having 32 bit processors powering them. The silver lining in this scenario, is that if you have access to the source code of a product, then you can compile it for 32 bit architecture and then use it.

This article shows how to download Redis source code, compile it using Visual Studio for a 32 bit architecture and then run it in a Windows environment.

Read on:

If you are a .Net developer, chances are that you have for majority of your professional life, written code on Windows platform, for Windows platform. On top of that if you have an old computer powered by a 32 bit processor, then you are striving to find ways to learn the new and up-coming technologies, such as NoSQL databases – MongoDB, Redis etc. which primarily have been released for 64 bit architectures.

I have been working with Redis since the past couple of months now and started learning Redis on my personal laptop which at the time of writing this article is 8 years young. This sometimes leaves me in a bit of a lurch as the newer projects and products are mainly focusing on releasing for 64 bit architectures. Well, all is not lost if you are willing to put up a little fight and compile the source code yourself, if it is available.

Thankfully Microsoft recognized that .Net developers should not get left behind when it comes to awesome products like Redis, just because they are not available to be run in the Windows environment, and hence they created a dedicated entity, Microsoft Open Tech Group devoted to porting these technologies in the Windows environment, and further the collaboration with the open source community. Redis is one of the projects that the group is handling at the moment.

Alright, so let’s run Redis on Windows in 32 bit architecture. Pre-requisite for accomplishing this is the newest version of Visual Studio 2013 with update 5, as without update 5, the process might not work successfully. If you do not have a paid version of Visual Studio, Community Version which is available for free here will also work.

1. Head over to Microsoft Open Tech Group’s Redis GitHub page for version 3.0 and download the source code available as a zip file.

2. Unzip the code in a folder in C drive. Make sure that the folder name in which the source code is housed bears a name with no space or special character.

3. Open the solution located in the msvs folder in Visual Studio.

4. Open the solution’s properties and go to the configuration manager and change the “Active solution configuration” to Release and “Active solution platform” to x86.

clip_image002

 

 

 

 

 

 

 

 

 

 

 

5. Now build the solution. Note there will be a few warnings that’ll come up, but ignore them.

6. Once the build completes, you will notice that there will be a new folder named “Win32” that would have gotten created. Inside this folder will be another folder “Release”. Release folder contains the final build and the executable files that we can use to run and learn Redis.

7. Locate the file “redis-server.exe” and execute it. It should come up looking something like shown here. This is the Redis server which by default listens on IP address 127.0.0.1 and port 6379.

clip_image004

 

 

 

 

 

 

 

 

 

 

8. Locate the file “redis-cli” and execute it. It should come up looking something like shown here. This is Redis command line interface and by default it sends commands on the address and port of 127.0.0.1 and 6379 respectively.

clip_image006

 

 

 

 

 

 

 

 

 

 

Lo and behold, we have Redis running in 32 bit Windows environment. Thanks to the brilliant folks at Microsoft for porting this valuable piece of technology to Windows environment.

Hello Redis

2015 is coming to an end, and I have not written as much as I should have. It has been a busy year for me on the learning end and I am glad about it. Slowly, but surely, I am moving my career in the direction that I always wanted it to go. This year has been the year of NoSQL databases for me.

There’s a storm going on in the NoSQL database world, each one vying to grab mindshare and occupy a place in your development stack. Now that developers have started to understand the segment better than before, these data-stores can be safely classified into broad categories per their use case fit, such as:

1. Want to write everything to file in a schema-less environment – go for document oriented databases like MongoDB, RavenDB etc.

2. Want to deal with deep hierarchical data and process it real fast – go for graph databases such as Neo4J, OrientDB etc.

3. Want to store everything in-memory for fast retrieval – go for in-memory data-stores like Memcached, Redis, Hazelcast etc.

and so on.

It is the first and the third categories in the aforementioned list, that can be leveraged in general purpose applications and either are already in enterprise-ready state or will be in a release or two.

I recently started learning about distributed caching solutions for one of my open source projects and thus began my journey to learn one.

A distributed cache is built upon the fundamental idea of separating out the caching component from the ones provided by programming frameworks like .Net and be hosted independently. When this idea spans several servers, it becomes distributed in nature, hence the name distributed cache.

Some of the major distributed cache products available can be found over at Wikipedia. Of particular interest are Memcached, Riak, Redis and Hazelcast, as they are free for any use and have got a wide community support. At the core of all products is the central idea of storing data in RAM as a key-value pair. Of course, different products differentiate from one another on the basis of features.

It has been a short while since I have been working with Redis, and I have decided to include it in all my web projects, if I have my way.

While this article is not having anything usable technical stuff or practical utility for that matter, I just wanted to write something, and at this time, Redis is all I have in my mind. I hope the departing year was a fruitful one for you, and I wish my best for the upcoming year.