OU blog

Personal Blogs

David Pennington

TM352 TMA1 done. Now onto the Cloud

Visible to anyone in the world

The TMA is out of the way. This one, I really don't know. The questions were quite vague and the answers I got from various tutors was a little confusing. Still, I got it done with about 5 days to spare. This sounds good, but I was nearly three weeks ahead with my reading of the parts. I attended two of the TMA tutorials hoping that they would help but I got the same advice - just answer the question. 

So, I have written the whole thing as though it was a report to the CEO of MegaMax - in that I have kept the flow going and explained any technical terms - mostly with references to Wikipedia. I am still not sure if I can say more as some people may have extensions so I will come back to the content in a later blog post.

I have moved on to Block 2. This is something that will really help me, if there is any meat in the block, of course. I did find that Block one was a bit meatless in places. I have had two goes at an Amazon AWS server. The first one was when I closed down our scale model shop (SBX in Ipswich) and retired. We were running a bunch of web sites and our own e-mail server on the shop server and we needed to keep these going when we moved out of the cottage into an apartment on the Ipswich waterfront (see my Blog at www.waterfrontblog.co.uk). It was going to take a couple of weeks, or so, to get the internet connection going at the new place so we had to get some cover. Because of the servers we were running, we needed a Windows box with a fixed IP address and AWS was offering free servers for one year and pay after that. This fitted our needs perfectly, or so we thought (you knew that there was a catch!).

When we got our first bill in, instead of being zero, there was a charge - not a lot but a charge none the less. It took some time to work out why this had happened as Amazon don't count downloads, they only really count uploads. Web servers, once you load them up, normally only have downloads - hence the idea that it would be free. We forgot about e-mail. For every download of an e-mail, there is an opposite upload, obviously! Doh! Fortunately, we got the server up and running fairly quickly and killed the Amazon one. 

My second go at a server was purely for fun to see if i could do it. I had built my own database for our shop software for two reasons. I had no experience then of working with SQL and as I code in Smalltalk, where everything is an object, there is a big overhead converting back and forth. Secondly, we had built our own Object oriented DB but it was a bit slow when handling lots of data and it took up a lot of memory. I didn't realise until I came upon such things in TM351 but I had created my own Key/Value No-SQL database. It was quite simple in that I created directories for each of the attributes I wanted to key on (in Riak, they are called buckets) so, for a stock item, I had a directory called stockNumber, a directory called supplier and so on. I just dumped the one stock object into each of the directories using the specific key as the file name. Windows file management is super fast when doing this sort of thing. Access anything up to, say, 100 records, would take no time at all.  So, when I came across Riak, I had to have a go. 

I opened up a new AWS server (under a separate e-mail address so I got this one free as well). Amazon have a template for a Riak instance so that was quite easy. I actually created a three node setup but they wanted to charge me for the other two so I closed them down again. I put together a little app that stores comma separated files and wrote a REST interface in my Smalltalk to manage the data. It works really well and is absolutely seamless. It is very quick when managing data blocks up to about 1K so it is worth thinking about your data and getting the bucket structure right. I had a few goes at this. I did try putting the CSVs into JSONs but in the end that overhead was just a waste of time as the CSV text files come and go very quickly.

I had some trouble with permissions over the firewall which I still haven't properly cleared up. I am hoping that there is a good bit of meat in this block to enable me to get this sorted. I am also signed up for TM470 and I have a project based around all of this but I will cover that next time.

Permalink Add your comment
Share post