# Thursday, 06 March 2014

There's a lot of buzz surrounding the whole NoSQL buzzword, and I've recently been able to give both Memcached and Redis a quick try and look over. And here are my initial findings follow some tests and poking around. Note that I'm by no means have very in depth experience of both these systems, I'm just recording my findings down so I can look back at it in the future to see if I still think of them the same way next time.

Memcached is the simpler one to explain, it's essentially an in memory store of key/value pairs. Which basically means it you're essentially storing values in the form of usersession.xyz="some session data" in it. This usually leads to questions about why one would need to use an external service to cache simple key/value pairs in memory when your platform might already have something similar (ie. the Cache collection in ASP.Net) but the nifty thing about Memcached is that you can configure it to be redundant and highly available spanning across multiple servers among other tricks.

Redis like Memcached is also about to store key/value pairs as well, but it is also able to store structured data, lists and weighted lists. Which you can then manipulate and perform some simple operations on them like sorting, joining, calculating. Conceptually I'm more inclined to just call Redis a simple In Memory Database, but I think that's complicating it a bit much! But not only is Redis an In Memory Database, you can configure it to persists it's memory contents to disk ensuring that data can be preserved between server restarts and applications crashes. But wouldn't that make it behave just like a traditional database then, not quite I'd say.

Both Memcached and Redis excel in the fact that retrieval and storage of data is LIGHTNING fast compared to a traditional database, and why wouldn't they be considering that all the data is held in memory instead of on disk. So what kind of problem would arise from using them? Why, memory usage of course! Since the 2 systems will just keep writing to memory, if you don't keep an eye on them they WILL take everything if you just keep stuffing them full of data.

I'll say that it's easier to handle Memcached's memory usage, since it's main role is to cache data. If it reaches the memory limit, it'll just drop older values to make way for any new values. After all the whole idea of a cache is that while it exists to speed up data access, it can easily be discarded and rebuilt from the original source.

But with Redis it's a different, as mentioned Redis is cooler than Memcache in the sense that you can perform data aggregation on it, in fact you might be tempted to just run your website ENTIRELY off Redis, but then there are a few caveats about it. The first being the fact that Redis doesn't support the concept of ACID very well, so you can't use it for anything where data atomicity is a must. The other more important caveat is that Redis is an In Memory database, the WHOLE database needs to be in memory at the same time so if you want to speed up the look up of that 6GB customer DB file with Redis? Sure you can do that, but you're gonna have to dedicate 6GB of memory to hosting that database and that's not something you might be able to do.

UPDATE 7th March 2014 : Just figured out that in Redis you can ALSO set it so that when it approaches a memory limit, it can auto discard elements and thus it can also work like a cached store as well instead of having to define everything to expire explicitly.

The way I look at it is that Redis is great for caching datasets which require constantly manipulation but you don't want to burden the database with the queries. And it'll work great as long as you can give it the memory to work with. Such as... an item listing database which you want to allow users to sort according to different criterias.

And that was my quick look at Memcached and Redis, interesting stuff and I can't wait to work with them some more... ok, not so much on Memcached probably, it's features are a bit too specialized. :P


Thursday, 06 March 2014 17:24:48 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Sunday, 23 February 2014

I keep forgetting how many years it has been at my current company, well I just received a 10 year service award, so it's at least that much then!

Has been an interesting journey seeing the company grow from a simple floor which you entered from an alley to a dark secluded shoplot floor to something which spans a couple of office buildings.

Wouldn't say it was an easy journey, ten years is plenty of time to accumulate various up and down experience. But of course it's been a great ride with a lot of wonderful people.

That said.. 10 years at the job and it doesn't seem to get any easier. But I guess that'd be too boring to last for 10 years then. :P


Sunday, 23 February 2014 01:19:11 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Thursday, 13 February 2014

Ever had this need to decipher a string to HEX form on the go? Or maybe you need to answer a client's email on how exactly to type out the value for the URL Encoded Query String while you're enjoying a movie with your significant other? Can't remember all the HEX values for a particular string? No problem, with M2StringToolkit you can freely convert between several formats easily. Currently supports the following encoding types with more to come!

  • Base64
  • URL
  • HTML
  • Javascript
  • HEX

Get it for your Windows Phone 8 device today!

258x67_WPS_Download_cyan


Thursday, 13 February 2014 10:24:23 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Monday, 10 February 2014

As I was browsing in my local RadioShack, I saw this thing called "U Mold Plastic" it delivered promises of a simple easy to use plastic like material which you could mold with your HANDS... I was intrigued to say the least, so I bought the last pack off the rack, and here's my hands on.


Monday, 10 February 2014 10:20:31 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Monday, 27 January 2014

I've just joined the statistic of "People whose maid ran out on them". Here's what I found surprising in the whole ordeal

  • That there are no signs that she wanted to run away
  • That the maid can literally just drop and leave EVERYTHING before running away
  • That all the authorities seem to treat it like a common day occurance
  • That there's a form which is titled "Runaway maid work permit cancellation form"
  • That said cancellation carries a cancellation fee

Well.. now I'm jaded I guess..


Monday, 27 January 2014 02:24:00 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  |