Wednesday 12 December 2012

When To Upgrade (and when not to)

I have often found people divided on this matter.  Some people always want to be on the latest version, it doesn’t matter what it is, but if there’s a newer version out there, they want it.  The other extreme is people clinging on to their old version and wanting it to run forever.  So much so that if they are forced to upgrade because of the operating system, they would rather run the older operating system as well.  There are arguments for both cases but camp A will get stung eventually when a new software release is detrimental and they can’t go back to the old version.  Camp B will get stung when they can no longer get support for their version and they are forced to upgrade.



So which is the better option?

Version Numbering


It comes down to understanding version number.



Version numbering comes in 3 Parts, Major Minor and Revision. A forth can also exist that refers to the incremental build number.



So we have version 1.4.8 of an application and they release version 1.4.9.  What can you expect to have changed in that release?  Not a lot in all honesty.  The most likely thing is bug fixes which were deemed urgent enough to make a release for.  It is these updates that you should avoid unless you have experienced the bugs in question.



The next upgrade might be version 1.5.2 this is a minor release; there may be improvements in security or a new feature requested by a number of users.  Again, I would be reviewing what the differences are between the two versions before upgrading.  If I’m never going to make use of those new features, it probably isn’t worth taking the risk of updating the software.



The Major release is the biggest upgrade you’ll encounter.  This could be a major overhaul of how the code works and the number of features that are available.  Not all major releases will have features added.  Some may be taken away because the development team have found they are troublesome to maintain and test.  Or based on user feedback have decided not to keep that feature.  Other reasons behind this could be incompatible operating systems or other software on the market or there could be legal reasons behind it.  The UI may have been overhauled giving it a different look and feel.  Users of Word 2003 to 2007 will have noticed a huge difference in how the application looks and operates (does anyone actually like the ribbon functionally compared to the humble toolbar?)

Switching Vendors


So there are reasons why you would never want to upgrade your software provided it is working as it should.  But what’s the other type of software upgrade?  This is where vendor switching comes into play.



Say you have Crystal Reports 8.5; you’ve kept with this version because it allows you to compile the reports and distribute them as Executables, thus eliminating the need to install an expensive licensed piece of software to all of the machines that need to run then.  Version 9 or later doesn’t allow you to do this so you’ve avoided upgrading it. After all, it works and you’re happy with it.



Sooner or later Crystal Reports is going to look very outdated compared to other companies software.  The terminology used within it doesn’t match any other products of a similar nature and guess what, anyone else joining your company isn’t going to have been trained in that version of Crystal Reports or maybe hasn’t even heard of Crystal Reports because it is that old.



So at some point you’re going to have to upgrade to something or face an extortionate bill finding the last person on the planet willing to get out of bed to support the legacy application.  I for one hope to make a mint out of writing conversion packages to take a report from one system and convert it to whatever other product is on the market e.g. SSRS.

Tuesday 11 December 2012

Its not my fault, the mechanic did it!

Whose fault is it anyway?

I recently had the misfortune of having to deal with a difficult "customer" but I was glad it happened because I've been waiting to use this analogy for ages.

The usual story with chaotic IT departments is that they get the blame for everything.  The customers lose faith in the IT departments ability to deliver or maintain and as a result whenever something doesn't work as intended the propensity is to blame IT.


The problem that was put to me was that if the system wasn't working, the stores couldn't process orders and do their work, and this creates a problem.  The regional manager wasn't getting that what he'd described was not our problem in anyway.  It was beyond our control and the users were actually part of the problem due to their lack of instruction, propagated by the lack of leadership in this area.  When the supervisor doesn't know how to do something, they can't teach their direct report staff how to do it either.  Enter the analogy.

The analogy

I asked him how he used to do things before the computer system was there.  A little bit of a struggle but in the end, he accepted there was always manual ways things could be done and a good old piece of paper and pen was always to hand.  I related this to his journey to work.

Before you had a car you walked to work, the invention of the Car made it much more convenient for you to get to work and cut down the commute time immensely.  You were happily commuting to work in your car for many weeks, you couldn't even remember how you got to work without it.  One day, the car breaks down and you get a quote from the mechanic saying it will take at least 3 days to fix.


So in the meantime what do you do?  If you don't go into work there will be consequences but who's fault is that?  Not the mechanics fault, you can't hold them responsible for you not being able to get to work.  You can shout at the mechanic in the hope they'll work faster but if they have got to order in parts and wait for them to be delivered that won't really help.  It's not the mechanics responsibility for you to get to work, the car is just a tool to aid you in doing the job.  If your car is unreliable, consider getting a new one (see my next blog When to upgrade and when not to).  The analogy can go deeper here about the similarities between vendor lockin and leasing deals on cars but that's not the idea of this blog.









Implementing SQL Emails in SQL 2000

Stop with the Polling

In lots of legacy systems there is a problem of polling.  A job or routine comes along on a regular basis and checks to see if there is some work to do.  When it finds something, it actions it and moves on thinking everything is great.  In even more disjointed systems, they will then have another polling job that should run as part of the other job, but for whatever reason decides to do its own polling to see if work should be done.

This creates a problem in many cases because Job A may come and poll again before Job B has had a chance to do its bit.  What if Job A is cleaning up after itself or overwrites what it did the first time and Job B hasn't had a chance to get what it needed to complete?  This is a common scenario for polling and one of the reasons it is bad in modern computer and why event driven processing is preferred.  Quite often this is solved by implementing a listening pattern but my problem didn't need to go that far.

Legacy Emails

One of the features of SQL Server 2008 is the ability to send out emails using the inbuilt stored procedures for handling mail.  This can be a very useful feature as it saves you having to have a mail client installed on the server and saves another failure point to check if emails aren't being sent.  My problem was the Jobs in question weren't on SQL 2008, they were on SQL 2000 which doesn't natively support this email functionality.  My initial thought was to write a client that would interface to the smtp server and I could call into this with xp_cmdshell.  I stopped myself short at this point because of code smell and realised this problem must have been solved before me.  We're in 2012 FFS!

Sure enough after some searching I was able to find the article that MS have written on this very matter
http://support.microsoft.com/kb/312839

Golden Hammer

The trouble is, now my work colleagues think this is great and have started flooding email addresses when jobs complete, fail, take too long etc.  I need to remember them that there's a time and place for everything and not all solutions can be managed with a simple email.  Plus if you're getting a lot in one day, surely a report on a daily basis would give a better indication of how big your problem is.  You may even want to keep an audit trail of when these things happen so you can get some meaningful stats in the longrun.



Thursday 1 November 2012

Perversions in Source Control


Working for a small company has some plus points and some bad points; one of the plus points is that the number of licences required for software is small.  You could argue that granting people more access than is necessary is a good thing, and the lack of paperwork that is required to make this happen is limited or non-existent.  Things actually happen when they need to rather than waiting around for the sherif to authorize things.

Source Control tools are readily available in both free and paid license form.  Having convinced the bean counters that this was completely free and wouldn’t cost them anytime to set it up, I was free to implement the much needed versioning control.

About 1 week after this was all implemented I came to realise it was all for nothing.  The fact that everyone still had full access to the database and files on the system in a live environment, people were still releasing stuff straight to live and completely negating the point of version control.

Lack of communication, are you part of the problem?

The Problem

An incident happened Today where I was reminded about the lack of communication and the harm it can do.  But it was also a reminder that people can be too quick to assign the blame.

I arrived early in the morning at work to find that some services on machines were not running and some jobs on SQL were still running that should have finished hours ago.

I was just about to start the services and kill the jobs when I suddenly had a thought about events from the day before.  I decided to ring my boss and ask him if he knew of a reason why the services were stopped.  His response went along the lines of this:


"Err yes, err, I had to errr, stop them, errr, because I needed to run one of the month end jobs again because it went out of sequence with another one"
"OK, I came in and saw that the services were stopped and was about to start them, I'm glad I checked now.  I didn't see an email though, are the others aware?"

At this point another of my work colleagues came along and he was filled in about the problems and what was bing done.

Later that day I went in to see a colleague and he was furious about what had happened earlier.  He said he'd spent hours trying to diagnose why things weren't running and slow performance on the network etc etc.  His main gripe being there was no communication to any of us that such a major decision / change had been made.

He was, of course correct.  My Boss hadn't said anything to anyone.  I told one person in passing after I found out and that person hadn't relayed the information to them etc despite the proximity of all people being so close.  However I couldn't help but feel that this guy was also part of the problem.  Like an employee trying to move a mountain one spoon/shovel at a time, they didn't stop for one minute to think whether they should be doing anything about it, or whether or not they should call someone to check.  I reminded them that communication goes both ways.



Proactive Solution

I always find it prudent now to be proactive and ask, "everything running OK?" to someone who is already in the office.  Rather than waiting to hear bad news or just assuming someone will eventually shout if I'm needed.

Sunday 14 October 2012

Exploiting filtering for SQL replication

I came across a novel way of making use of SQL Servers replication the other day.  It erked me so much I thought I would share it with the rest of my casual readers to see what they think about it.  I may just be too much of a purist but the way it was implemented went against everything I've learnt as a computer scientist.

Replication Filters


For those that are unfamiliar with replication, the idea is to propegate data from a central database down to subscribers.  In terms of a business model, this might be head office as the replication publisher and the branches are the subscribers.

For each block of data that needs to get replicated, you can apply a filter as not all data may be relevant to the subscribers.  This would normally be in the form of a Flag for one of the columns, or where the date is within the last x days etc.  The options are only limited by the design of ones database, or in this case, the person's imagination.

The filter applied was:
SELECT <published_columns> FROM [dbo].[Branch] WHERE Code = HOST_NAME()

*HOST_NAME() usually returns the machine name that the script is running on
 

Publisher and Subcriber


The normal process is for the Publisher to Push the data, or the subcriber to pull the data.  Either is pefectly valid, it just depends where you want the processing load to lie.  If you have a lot of subscribers it would be considered  best practise to focus the load on the subscribers so therefore it would be a pull subscription.

When the subscriber runs , it issues a command to SQL server to synchronise the data.  There are various switches and options that can be applied to this command.  One of them is [Hostname].  In this particular instance they have specified a different hostname depending on which branch the subscription is run on.  Therefore the Hostname matches up with the Code column of table Branch.

replmerg.exe" -Publisher [EPOSTEST] -PublisherDB [POSCentral] -Publication [Merge_POSCentral] -Subscriber [eckpostest2] -SubscriberDB [POSPEN] -SubscriptionType 1 -SubscriberSecurityMode 1 -Distributor [EPOSTEST] -HOSTNAME [PEN] -QueryTimeout 300 -LoginTimeOut 30


Aside from the fact this is not how the [Hostname] flag was intended to be used it masks what is truely happening.  When SQL scripts run the hostname and other windows data is used to audit who ran the script on which machine and at what time.  To someone who is unfamiliar with this logic in the replication may end up searching for a machine on the domain that doesn't exist.

What's more is this functionality is not guaranteed to work with future versions of SQL server because the hostname flag is a minor option of replication.

Friday 12 October 2012

The Art Of Wiki Writing

Having introduced an internal wiki to a company and it instantly being a hit, the role of application support has come on leaps and bounds.  However some people are yet to embrace the creation of such pages, or are going about it in a sub optimal manner.

These are some common misconceptions about the wiki that I'm sure will come up again in the future, (cementing my views about point 1).

1) Why do I need to write that down, I know how to do it now?
Yes you do, but will you remember in 3 months time? especially if it's a less common occurance. Also the wiki is not just for you, it's for everyone.


2) I don't want anyone to change my posts, what if they fill it with false information?
Perhaps you should work on your control issues?  Also there is a history you can revert the pages to, so if a page does become "corrupted" you can restore it to a known good page.  Remember, things change all the time and this includes instructions that you've written on wiki pages.

3) I got this error message, I'll just take a screen shot and post it on the wiki, job done.
That's great, but when someone sees an error the message they are likely going to want to search for that error message on the wiki.  In a perfect world it would be able to search the image for text, but until that point comes, it might be a good idea to write out the error message in plain text to accompany the screen shot.


4) I can't show the text as I intended because it has special characters in it.
With any markup language there are escape characters to be used, or escape tags.  Nearly all wiki's will have a page dedicated to the usage/formatting of the wiki.  It should simply be a case of surrounding your text  with the escape characters so your post can be shown as intended.




Tuesday 2 October 2012

The Little Differences

Having spent one month in Australia now, I've had a good chance to see how the little differences between the UK and Australia can make all the difference  (well NSW, and Sydney specifically).  I'm not suggesting either one is better than the other, merely observations that can make a big difference in your daily life.


Pennies: 

Firstly, there aren't any.  The smallest denomination is a five cent coin.  However Prices are still advertised at $1.99 so how does that work?  Well, rounding.  When you get your receipt they will round it to the nearest five cents.  Sometimes you gain, sometimes you lose.


Bed frames:

Now I found this one out the hard way when I ordered my bed, and it wouldn't fit up the stairs.  In the UK if you order a base with the mattress, the base will be split.  In Australia you have to ask for one like that specifically apparently.  Plus it's more expensive because it's not the norm.


Zebra Crossings:

Now this appears to be 50/50 amongst motorists but don't be surprised if they'll completely ignore the fact they are approaching a Zebra Crossing.  If you step out in front of them, they'll do their best to stop (screeching and handbrake incl) , but half of the motorists don't expect to have to stop when approaching one and they certainly won't stop unless your foot is on the tarmac.


Pelican Crossings:

I guess I just got used to the fact that when the green man is on, it's safe to cross.  In Australia, all it means is as a pedestrian you have right of way.  Cars will still be coming at you from any which angle and one has to be trusting that they are aware that people might be crossing.


Vernacular:

This one goes without saying, but you can get yourself into a lot of bother by using the following words in the wrong context.  Thong, Router, Scuba Diver.  Tread carefully as they say.


Paying By Card:

In the UK, it's very simple; you have a debit card for your current account and maybe a credit card that may or may not be issued by your bank.  When you put your card in the machine you enter your pin and that's about the only interaction you have with the terminal.  In Australia, the first thing you must do it select what account type it is, credit, savings or cheque?  WTF why doesn't the terminal know that from the card I've put in?  Plus your Pin number doesn't have to be 4 digits.  So I've gone for a nice lengthy 12 digit one just to confuse the cashier.  Plus it plays a nice tune if you get the tempo right (Think A Team).





Monday 24 September 2012

A not so global internet

I'm in a somewhat unique position to share my findings about how websites treat users who change their location to another country.  While there may be some good legal reasons for not showing content in other countries, as a user who has expressed a valid reason to switch which country they are accessing the site from, you'd expect everything to behave as expected.

Googlemail and hotmail both picked up on the fact I was accessing their sites from ip addresses outside my home countrys' range.  With this came a raft of security questions before they would allow me to continue.  This was an added peace of mind that some random chinaman wasn't sifting through my personal emails and seeing how many meds I'd been buying on-line.  As a result I didn't mind the inconvenience.

Facebook on the other hand seemed to miss the point.  After asking me all of the security questions and allowing me access, I changed my current location to a suburb of Sydney, Australia.  (A huge milestone by anyone's standards).  To my surprise all of the advertising is still UK based.  What's more is I'm getting adverts for removal companies and Emigration agents.  For more on this see Steve Fenton's Blog http://www.stevefenton.co.uk/Content/Blog/Date/201209/Blog/Invasive-Advertising/Now I'm sure there might be a profile setting somewhere that controls this, but why should I have to change this?  My Location should dictate the globalization settings.

Spotify also amused me, I could choose between switching to Australia, or buying a subsciption to allow unlimited travel.  I decided I'd do both, but when I came to pay, the only option was to pay in £'s!  So for now I've chosen to stick with the free service.

There have been plenty of other sites that seem to have fallen foul of this key element when making a website global.  I can understand for companies with a separate .com.au site, but if you're boasting a .com site, at least make sure it works in across countries. (I guess UAT is an expensive undertaking).