Friday, 22 June 2007

Enough with the marketing, what about the technology?

What we’re running…

As you can see from the Betfair site, there are four key products namely Sports Exchange, Games Exchange, Poker Product and a Casino. These products employ a myriad of technologies for various components, but the exchange products run a large scale J2EE application on an Oracle data base. Oracle tells us that we are in the top three hottest data bases in the world. Our J2EE application currently runs on JBOSS with a Tangosol distributed cache to manage our aggressive caching strategy.

Seeing as this is a Front End technology blog I’ll concentrate on the client-end of the Betfair systems. The front end of our application has been using an AJAX pattern since before there was a catchy name for it. The front end of the application is all ‘pull’ based and uses a polling mechanism for dynamic market information. While pull is not the most efficient form of distributing the changes on dynamic information, a push mechanism in a browser introduces another set of challenges, scalability is just one of them. Our infrastructure is highly tuned for this type of application. One of our key metrics is the requests per second for market data. The front end is made up of bespoke JavaScript libraries targeted at the high-performance nature of the Market updates and bet placement.

We currently run 2 exchange businesses in the form of the Sports and Games exchanges. We have different usage profiles for each, but they both operate the same exchange concepts in 2 geographically separate infrastructures.

Some stats:

Page impressions: 600million+ per day.

Bets placed per day:

  • Sports: 5 – 8million bets per day.
  • Games: 8 – 14million bets per day.

Wednesday, 25 April 2007

A perfect fit for the web; a bit of Betfair background...



What is this Betfair thing all about?

If you’re familiar with dealing in shares or trading on eBay then you’ll be very familiar with what makes Betfair work. Betfair is a betting exchange that allows people with opposing views to bet against each other. Before Betfair came to the party the only way to have a bet was at your local bookie where you would invariably choose which team/competitor you believe will win a sporting event. While with the bookie you can ‘back’ a team/competitor you believe will win, you never had the oportunity to bet that a particular team would lose. Betfair brought the ability to ‘lay’ a team/competitor to the market place. Being able to lay, or bet against a team, allows you to take either a win or lose view as opposed to just taking a view that "this is going to win".

Backing and laying a team/competitor is much the same as buying or selling shares. When you back a team/competitor you do so with a stake amount of money at odds you believe represent good value for money. Backing is the type of bet most people are comfortable with mostly because your stake is the most amount of money you can lose; your liability on this transaction is implicit. Laying a team/competitor has the added complexity of a liability that is dependant on the odds you choose.


Let me explain...

For argument’s sake lets assume we have a sporting event we can bet on where we have a TeamA and TeamB. For this event, let’s assume there can only be one winner which we can back and lay at the available odds. At the beginning of the event we have a hunch that at odds of 4/1 (decimal odds of 5.00) TeamA is likely to be a winner, so we back it for £10 at 4/1; if TeamA wins this event we will make £40, if they lose we lose our £10 stake. As the event is being played out we can see that our hunch was right, but we are not the risky type, we take fixed rate mortgages and we want to cash out on this team. As this game has gone along we can see that the odds on TeamA have shortened to 2/5 (decimal odds of 1.39) so we decide to lay it. At this point we have just locked in £36.10 on TeamA no matter what happens in this event.

You can back and lay at the same time if the odds swing your way. Think about it. If the odds are high, you can bet that someone will win. If the odds shorten, you can bet they'll lose. The difference is pure profit. There are a myriad of strategies people employ to lock in profit on the exchange; each user is looking for an edge over others. The above example is just one of the many betting related activities you can perform on the site. There are ways to get yourself out of trouble if your hunch goes wrong, damage limitation, and ways to manage a trade into a more likely matching position*.

You can bet while the event is being run!

Oh yes you can. The horses have just come around the last bend and are racing to the finish line and you can bet all the way through. Hitting the little market ‘refresh’ button on a heavily traded market is like watching some sort of Matrix style display with numbers changing as quickly as you can click. This is all just a reflection of all the people trading on the market constantly taking different positions.

*This gets me onto the subject of bet matching which I will cover in a later post.