OU blog

Personal Blogs

David Pennington

Lots of activity with NOSQL

Visible to anyone in the world
Edited by David Pennington, Wednesday, 4 May 2016, 15:30

I got 72 in my TMA01. Great results for the coding side and a bit of a disappointment with the written work. No surprise there, then!

In the meantime, I got on with the course work and hit the section about NOSQL databases. Now, this is my territory.

Background.

Until I retired, four years ago, I owned and ran a scale plastic model shop here in  Ipswich. This was in addition to my programming activities. I wrote all the till software and all of the web stuff - in Smalltalk. We have a true OODB written in Smalltalk but it had a few performance problems so I decided to create my own. VisualAge Smalltalk has two nice classes - ObjectDumper and ObjectLoader. These write out and read in objects in a binary form. I simply used the file system as a means of using the database so it worked like this.

I had a nice User object and each user had a unique key. I simple wrote out each user to a file inside a directory called "user" with the unique key as the file name. I then wrote out similar copies under the postcode, surname, town and so on. It seemed a bit makeshift at the time but it worked really well and it scaled very nicely. It wasn't until I read the "Seven databases in seven weeks" book that I realised that I had built my own key/value pair NOSQL database!

As I have plans for my final project course that will require a fast database, I decided to build one using Amazon AWS so I signed up (for about the third time) under a new e-mail so that I could get a free instance. I  then had three days of agony trying to get a Riak database in place. Firstly, I had to understand that I didn't create an instance and then put Riak into it. I used the Marketplace Riak option to build a dedicated Riak server. I did this for three instances and then tried to connect them. That is where the real hell come in to play. It took me two days to sort out how to cluster the three together. I finally managed it yesterday and now have a nice three node Riak database working. I know that I will probably have to pay for two of them but firstly it is tiny money - about $7 per month and secondly I can always stop them when I am not developing on them. 

Having got on very well part 14 - MongoDB stuff, and got most of the next CMA done, I can get on with playing with my new toy. My first thing to do is to get my Smalltalk image to talk to Riak. This is just a case of writing a GET and POST method in my application. Once that is done, I can get on and implement all of the Riak calls. This should be fun. I shall report on this in future blog posts.

In the meantime, MongoDB awaits. I am interested in this because my son uses this at his work. It will be nice to be able to extend our conversations in that direction.


Permalink Add your comment
Share post