Thursday, August 14, 2008 12:31:01 AM (GMT Standard Time, UTC+00:00)
Ploughed through some stuff last night, so here is that to-do list with a few things removed, and the most recent items dealt with. The client is so much more stable now I've tweaked the connection string to turn on some options to deal with the ferocity with which the client can push/pull data from the cache. Also added a few new services so data can be submitted in nice little compressed batches, speeding things up to no end. On a train a while ago I wrote the SDK for .NET and I'll be duplicating that for PHP when I get the chance. The Wiki is actually halfway to being populated but I've had some ideas about that elusive graphical snippet designer so perhaps it won't be needed as much as I thought. We'll see.
Core Scrobbles
- Friendly URLs
- Referal system for 'earning' queries
- Compressed Raw Data Queries
Compressed Batch Data Submission
- Registration System
- Arbitrary Views (using Snippet System)
Automatic Data Submission (Scrobbles App)
- Security/Validation of All Existing Forms
Third Party
- Online submission of WoW Data
- Heatmaps (location tracking)
Community
- Wiki
- SDK for PHP
- Service Documentation
- Snippet Documentation
- Family/Key/Value Documentation
Wednesday, August 13, 2008 4:43:43 PM (GMT Standard Time, UTC+00:00)
After getting a few silly, random things exorcised from my system, I sat down last night and set to work on the Scrobbles client and libraries, as these have been neglected while I have been working on the core server-side stuff.
Last time I left them, I was dealing with some problems to do with the situation where the user upgrades the Scrobbles client, and that client uses a newer database schema for the local cache, or the web services change so data can no longer be submitted the old way. This is quite a rare occurrence, but it just so happens that in my latest overhaul a couple of months ago I completely changed the web services and now have 500mb of unuploaded data sat on my hard drive needing migrating one way or another. And if I'm going to do it nice, I may as well write a system that can cope if I have to change things again in the future rather than just doing a one-time migration on my computer alone.
I had a few options to choose from, that I could think of.
- When a new version of Scrobbles is installed, do an in-place migration from the old cache to the new cache
- Keep the old web services intact and add newer ones seperately, with migration happening server-side per submission
- Write an adapter for each new schema, mapping old data into new data before passing through any new code
Each of these had its own pros and cons, chiefly to do with the resources that each method would require from either the client computer or the server, but also to do with the maintainability and reliability of each method.
- Doing an in-place migration would require that it be capable of migration from any previous version to the modern version, and potentially have to migrate across several hundred thousand rows - this is hardly a background operation and would be prone to problems if migration was cancelled by the user.
- Not breaking older clients wouldn't give users an incentive to upgrade, and the server would have to start having to do quite a bit of work to translate older requests into newer ones, and having resolved to make these web service calls as thin as possible this would go against that.
- Adapting the data client-side moves the burden of translation from the server to the client, and while translation from any previous version would still be required, not being done in bulk would mean this could be a transparent process.
All the above would require that the client would have to be capable of dealing with there being multiple cache files present, and be able to find out the version of each cache file. Initially this was going to be achieved through naming the cache file by its version, but I've never been one for naming conventions having been completely previously disgusted by the heavy reliance of them in Lionhead's The Movies. I instead added a Metadata table to the cache database and set a version in that. This means this can be checked for with a simple query on opening the cache and the relevant actions chosen.
I decided in the end to go with the final option, of creating adapters around existing code, mapping various methods and classes through a common interface. It involves a bit of work anytime I have to change the data structure between storage and uploading, but it means not having to modify existing code that already works when upgrading. It also means that each client can deal with software that uses older versions of the client library to create old cache databases.
It doesn't strike me as the best solution because it doesn't feel as elegant as I generally like things to be, but it shall suffice as I don't expect to be changing things too often anyway!!
In other news, I have resigned from my post at the University of Reading, and have taken up employment elsewhere. This saddens me slightly, but the new company does look like it's going to provide some interesting times. Because it's a real job with a scary looking contract, I'll refrain from mentioning who they are until I know what their blogging policy is. I don't want to get in trouble by suddenly becoming googleable to those concerned.
Anyway, onwards to a great deal more money, and to a more structured day - it should be interesting (at least, until Scrobbles makes me a millionaire..
)
Tuesday, August 05, 2008 4:34:02 PM (GMT Standard Time, UTC+00:00)
This weekend I headed up to Kendal and had myself actually quite a good time, despite the gallons of mud caused by a downpour on Friday night. There are many complaints to be had about the organisation and the price considering the actual acts being put on, but I don't care about any of those things cos there was plenty of entertainment to be had nearly all hours of the day if you just loosened up and enjoyed the chilled atmosphere.
Friday
We arrived on Friday evening, and immediately set up the tent because it had stopped raining. No sooner had we finished doing this and got ourselves and stuff inside the tent then the heavens opened up and started soaking people outside still trying to put their tents up. The Friday night lineup was appalling so we just sat in the tent drinking and listening to the ambient sounds coming from the main tent which we'd parked our tent just behind.
Saturday
The previous night's downpour left us with a field full of mud, so after failing to find wellies that fit me, I just went bare foot and enjoyed it.
I ended up stripped down to a pair of shorts and was soon frolicking in the mud for pleasure. Later on while watching the guys photographed below (no idea who they are) I realised I was pissing blood from my foot after cutting it on something, but the mud and crap soon acted as a clotting agent and put a stop to that...
Photos end here as I was getting a bit drunk and I wasn't going to risk falling over in the thick mud and getting the camera dirty. A good evening though, slightly ruined by the Super Furry Animals being a crap band, but only slightly as the local Kendal talent during the day made up for that.
Sunday
Sunday the mud was getting a lot firmer and after grabbing breakfast I settled down in my favourite tent to watch some folk covers of some awesome songs by Johnny Cash and Steve Earle by the Wild Wood Band (known also as the Wyrd Strings when doing their silly stuff). Talented guys. That tent was lovely too, lots of straw to lie down in and a really chilled atmosphere to boot.
The sun was coming out and straw was being provided for people to relax in, and people started making mud sculptures out of the now rather substantial mud.
It was nice to see people enjoying themselves so I spent a couple of hours just wandering about, flitting between the various stages and getting the occasional cup of tea from my other favourite tent (a cafe serving five bean chilli and doing their own little DJ set).
Next up I met up with some of the delightful people from the bsp crowd and partook in smuggled cider and... another other questionable liquid. It was nice to see some familiar faces and I sat outside my favourite tent with them until it was time to go see The Witch and the Robot (one of my favourite bands at the moment). They were, as expected delightfully odd and a pleasure to watch once more.
Eamon Hamilton was on straight after and was another of the very pleasant acts on this day.
After this, we packed up our tent and after getting a photo of the festival flag in action, I put the camera in the car for the rest of the evening.
On arriving back into the festival site, I headed down to the dance tent where it was probably about time for EMF to be performing. For the novelty value they had to be seen and I was lucky enough to turn up just as they started playing "Unbelievable" and left straight after. Timing or what?!
British Sea Power were as always a delight to watch, and I met up with some fellow flag makers who I spent the rest of the evening with along with some other people who I had met during the day. Having people to help wave mine and Jo's massive flag was a real bonus, and by the end of it my arms were absolutely dead.
I had to spend an hour posing with people and the flag whilst they held on to me for support in the thick mud and I sank deeper and deeper... but I'm hoping at least I'll find a good photo to use in the competition.
A good weekend all in all, although slightly marred by the day after where my grandparents made me go to A&E for the aforementioned cut in my foot. They scooped out all the crap, x-rayed it to make sure nothing else was in there, bandaged me up, and put me on antibiotics while getting a telling off from the cutest nurse I have seen in a long time - I was not complaining. (Hey, if you're reading this get in touch yeah?
).
Trains on the way back were cancelled and I ended up getting a taxi from Birmingham to Reading courtesy of the rail services. Say what you like about our public transport but at least they look after you when things go wrong!