Friday, July 20, 2007

A Design Pattern Template for High Performance Messaging

This is a work in progress. High performance messaging is hard. There are many parameters which can be configured (or misconfigured) so I'm working on a series of pattern templates. Work in progress...

Pattern Name

{ Source: Single.All Topics, Receiver: Multiple.All Topics }


Related Patterns

{ Source: Per Topic, Receiver: Per Topic }


Topic Methodology

Source per topic
{ Single.Source , Receiver.All Topics }

Group Rate Control Policy

Extreme 1 { Sender.Rate.Slowest Receiver, Reciever:at leisure)
Extreme 2 { Sender: Fast As Possible, Receiver: Try to keep up)
Middle Ground (Send.Minimum Data Loss, Receiver.Minimise Latency)

Transport Protocol



Operating Environment

Related Patterns
So How Fast is an APR Hash Table?

Just ran a quick metric on uploading approx 20K stock information items into an APR hash table on a heavily loaded (load avg ~4), Sparc III based Solaris 8 machine. It took 32ms to load which works out roughly 1 microsec per apr_hash_set() call. Each data item was roughly 140 bytes long - not bad for an old machine.

Wednesday, July 18, 2007

Developers, Developers, Developers?

If I could summarise, in one word, the general trend in Investment Banking IT over the last 8 years I'd say it's been one of mediocrity. However, thanks to the demands of High Frequency Finance, the tide is turning back towards hiring talented programmers capable of working closely with the business to craft high performance, high quality solutions that deliver real competitive edge. It's beginning to feel like the old days, when the focus was on technical excellence and delivery.

This sorry state has come about by the ingress of consultancy-led management (ie writing endless documents not code) and reinforced by HR policies such as "segmentation" where the aim of the bank is to hire average programmers at average salaries - indefensible. I'd rather pay top dollar for a girl/guy who can get the job done in a 10th of the time and cost.

I'm sure we've all seen the infamous "Developers, developers, developers" video - quite bizarre. I beg to differ, in Investment Banking (IB) I'd say it's "Traders, traders, traders" - at the end of the day - the business pays the wages...

I remember my first interview with a scary looking, fast talking New Yorker who ranted for half an hour about "only hiring the best in the world" - gulp I thought. All of a sudden he stopped and said - over to you. I told him - hey look - I'm not the best in the world - but I've done x, y and z etc - he said - right - you're hired on the spot. It was a big shock, I turned up first day in a new suit, so nervous that I forgot to cut the tags off. I was working with 40 quants (mathematicians/physicists mostly), working on fixed income stuff that was way over my head at the time. And so began my career delivering production quality solutions. Some good advice given to me when I first darkened the doors of a prestige tier 1 IB in 1996:

- No one will tell you what to do here - it's up to you to make your own role.
- IB is all about making money - not about elegant, cost-efficient architectures.

Today, however, the attitude of some developers in beggars belief. I was talking a guy a little while back who said "I don't care if a trade takes half a second or a second to route - I like programming in language X on platform P - it has a nice environment and is very productive". Sure it's nice and quick, how stable is the platform though? What about scalability? What's the clock resolution of the platform? How fast can it handle low-latency high performance streaming messages?

High Frequency Finance demands high performance data, calculations and messaging combined with a stable platform which scales well. Some platforms just aren't up to the job - caveat architectos.

To illustrate, I was flying to the States last week and enjoying the in-flight movies. The interface was perfunctory and seemed to do the job. I paused the movie a couple of times and noticed that the screen froze as expected but when I resumed it had been playing in the background all along. I then tried to rewind - and that didn't work either. Now lying to users is not good - not good at all. Then someone complained that their movie had "crashed" - so the steward decided to "restart the system". As soon as the first selection screen came back up - the whole plane pressed the movie button - boom! The system had to be restarted again, and again, and again. I never did see the end of the film. So you think I'm going to use this platform to build a trading system? Perhaps not...