SlideShare ist ein Scribd-Unternehmen logo
1 von 63
Downloaden Sie, um offline zu lesen
FROM BETTING TO GAMING
         TO TRADEFAIR
         Matt Youill, Chief Technologist, Betfair
         Asher Glynn, Primary Initiatives Manager, Betfair
         QCon, London UK, March 2008




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
INDUSTRY / TRADITIONAL BOOKMAKING.

                                                                                     • Bets are only made between the customer
                                                                                       and the Bookmaker.
                                                                                     • Bookmaker sets odds (prices) and factors in
                                                                                       a margin.




                                                                                         Traditional Bookmakers are still major
                                                                                         players in the gaming industry.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
INDUSTRY / BETFAIR EXCHANGE.

                                                                                     • New bookmaker Betfair appears in 2000.
                                                                                       Defined the Betting Exchange concept.


                                                                                     • Customer’s bets matched between
                                                                                       themselves.
                                                                                     • Customers set the odds (prices).


                                                                                     • An exchange has “perfect” risk management
                                                                                       and therefore, a lower margin.
                                                                                     • Commission on winnings.
                                                                                     • Prices around 20% better than Traditional
                                                                                       Bookmakers.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
INDUSTRY / BETFAIR CASINO, POKER AND
         GAMES.
                                                                                     • Complete portfolio of gaming products
                                                                                       complements the exchange.


                                                                                     • Strategically key for Betfair.


                                                                                     • Share Betfair’s principle of fairness such as
                                                                                       the “Zero edge” Casino.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
INDUSTRY / BETFAIR.

                                                                                     • Betfair operates a betting exchange, games
                                                                                       exchange, poker room, and casino.
                                                                                     • Annual revenues in excess of £200 million.
                                                                                     • Over 1,000,000 registered users.
                                                                                     • Over 1500 employees in offices globally.


                                                                                     • 5 billion page views/week.
                                                                                     • Almost half of all global traffic to gambling
                                                                                       sites comes to Betfair.
                                                                                     • £2,000 deposited every minute.


                                                                                     • World’s leading betting exchange.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
INDUSTRY / TRADEFAIR.

                                                                                     • The Tradefair exchange, a subsidiary of
                                                                                       Betfair, launched in late 2007.


                                                                                     • Currently offering financial binaries and
                                                                                       spread betting.


                                                                                     • Accessible, available, transparent retail
                                                                                       channel.
                                                                                     • Commission on profits.


                                                                                     • Prices very closely reflect the underlying
                                                                                       market.
                                                                                     • Very low cost trading direct to customers.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
CHALLENGE / TRANSACTION PROCESSING.

                                                                                     • Numerous challenges when delivering these
                                                                                       products directly to customers over retail
                                                                                       channels.


                                                                                     • Security on the wild west web.
                                                                                     • Low capability devices - browsers, mobiles,
                                                                                       etc.
                                                                                     • Channel predictability.
                                                                                     • And so on.


                                                                                     • State management , particularly the
                                                                                       changing of and delivery of state (a.k.a
                                                                                       transaction processing) very difficult.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
CHALLENGE / BETTING EXCHANGE.

                                                                                     • The exchanges have very large capacity
                                                                                       requirements.


                                                                                     • Currently, up to 1000 transactions per
                                                                                       second.


                                                                                     • Desired objective of 50,000 low cost
                                                                                       transactions per second.
                                                                                     • Plus increased reliability, maintainability, etc.
                                                                                     • The 100X project formed to achieve these
                                                                                       goals.


                                                                                     • A transaction = a bet placement, a cancel or
                                                                                       an edit.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
CHALLENGE / EXCHANGE TRANSACTION
         ENGINE.
                                                                                     • The Betfair exchange’s “flux capacitor” is the
                                                                                         Exchange Transaction Engine (ETE).


                                                                                     • It provides 4 key functions:


                                                                                     • Exposure: Validates and stores bet orders,
                                                                                       reserves customer funds.
                                                                                     • Matching: Matches customer’s bets and
                                                                                       reports the result.
                                                                                     • Bet Management: Allows customers to
                                                                                       view the status of their bets.
                                                                                     • Market View: Allows customers to view a
                                                                                       summary of all the bets placed on an event.


                                                                                     • Most have parallels in financials.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
CHALLENGE / EXCHANGE TRANSACTION
         ENGINE.




                         Exposure                                        Bet                              Market
                                                                         Management                       View




                                                                          Matching




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
CHALLENGE / EXCHANGE TRANSACTION
         ENGINE.
                                                                                     • Currently implemented in PL/SQL on a single
                                                                                       Oracle instance.
                                                                                     • Rated as one of top 5 “hottest” Oracle
                                                                                       databases in the world.


                                                                                     • Since Betfair was founded it has been a
                                                                                       constant struggle to satisfy capacity
                                                                                       demands.
                                                                                     • Why?... Growing pains aside, it is because
                                                                                       Betfair’s rules of fairness present a challenge
                                                                                       when scaling the Matching component of the
                                                                                       ETE.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
CHALLENGE / MATCHING.

                                                                          • Betfair has two key business rules…


                                                                             Best Execution (Best customer value)
                                                                             Each bet placed is matched against opposing bets
                                                                             in order of descending odds.


                                                                             First come, First served (Fairness for all)
                                                                             The first bet placed is the first matched exclusive of
                                                                             others.


                                                                          • Means everything processed serially.


                                                                          • There is an unavoidable traffic jam in the
                                                                             business rules.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
CHALLENGE / MATCHING.

                                                                                     • Rules only apply per event.
                                                                                     • Means system can be scaled by processing
                                                                                       each event in parallel. (Similar to the
                                                                                       concurrent execution of trades on financial
                                                                                       instruments).
                                                                                     • But…
                                                                                     • The nature of big events, particularly horse
                                                                                       racing, is that they are short lived and start
                                                                                       times rarely coincide. (Unlike the more
                                                                                       evenly spread activity on financial
                                                                                       exchanges).


                                                                                     • Over 75% of betting activity at any one time
                                                                                       is on a single Betfair event – the “hot
                                                                                       market”.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
CHALLENGE / EXPOSURE AND BET
         MANAGEMENT.
                                                                                     • Exposure and bet management are less of a
                                                                                       challenge as they occur on a per customer
                                                                                       (account) basis.


                                                                                     • With activity roughly evenly spread across
                                                                                       accounts, and peak activity on individual
                                                                                       accounts relatively low, it’s possible to
                                                                                       simply partition by account.


                                                                                     • Parallelisation, partitioning and distribution
                                                                                       provides sufficient capacity.


                                                                                     • Except, of course, in the case of a big
                                                                                       individual users. But none of them are that
                                                                                       big…yet.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
CHALLENGE / MARKET VIEW.

                                                                                     • The Market View or the view of the odds
                                                                                       and stakes currently available on an event is
                                                                                       challenging but in a different way.


                                                                                     • Every transaction will potentially change the
                                                                                       view of a market.
                                                                                     • Hence, every transaction requires the new
                                                                                       view to be delivered to customers.


                                                                                     • This is a lot of information that needs to go
                                                                                       to a lot of people many times every second.
                                                                                     • Multicasting scales effectively but in the
                                                                                       world of the web it is harder requiring
                                                                                       manual polling, AJAX, Comet, etc.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
APPROACH / THE PIONEERS.

                                                                                     • Many initiatives tried before.


                                                                                     • Approached as optimisations or evolutions of
                                                                                       the existing engine.


                                                                                     • Optimizations - hardware upgrades, index
                                                                                       tuning, schema reorganisations, etc.


                                                                                     • Evolutions – product solutions, functional
                                                                                       partitioning, asynchronicity, etc.


                                                                                     • Essential yet modest gains.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
APPROACH / 100X PROGRAMME.
                         “100 times (100X) more transactions per second”
                                                “Infinite capacity at zero cost”

           • At the time of initiation (500 TPS -> 50,000 TPS)
           • 10,000% target.
           • Challenge existed for many years, well defined. Solution less so ☺.

       Phases
       Investigation                           Had this problem or anything like it been solved before?
       Research & Design Sketch and elaborate various architectures.
       Proof of Concept                        Multiple Vendors including Betfair Engineering. Build, test and
                                               compare.
       Integration                             How to get into production? What changes and compromises
                                               needed?
       Build and Deploy                        Build the “Lite” version and plug it into the live system.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / CONCURRENCY (ISOLATION).

                                                                                     • Each of the major functions in the ETE
                                                                                       require exclusive access to either an account
                                                                                       or event (market).


                                                                                     • Rather than client sessions acquiring and
                                                                                       releasing locks on particular pieces of data,
                                                                                       each instance of an entity is assigned to a
                                                                                       single execution unit (i.e. Actor). Unit A may
                                                                                       own Account 123, or unit B may own Market
                                                                                       456 for example.


                                                                                     • With execution units tied to individual
                                                                                       entities, access is inherently serialised and
                                                                                       “transactions” are isolated from one another.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / CONCURRENCY (ISOLATION).

           Exposure &                                            Exposure &                                Exposure &
           Bet Management                                        Bet Management                            Bet Management




                                      Matching &                                             Matching &
                                      Market View                                            Market View




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / CONCURRENCY (ISOLATION).

           Brokering &                                           Brokering &                              Brokering &
           Order Management                                      Order Management                         Order Management




                                      Matching &                                             Matching &
                                      Order Book                                             Order Book




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / CONCURRENCY (ISOLATION).

                                                    Account
           Exposure &
                                                    Account ID           Funds                                  Exposure
           Bet Management
                                                    1                    £1,000                                 £735



                                                    Bets
                                                    Bet ID               Type                 Runner                       Odds   Stake
                                                    1                    Bet For              Field Commander              12.5   £10
                                                    2                    Bet For              Wingate Street               6.8    £20
                                                    3                    Bet For              Keyton Grace                 19.5   £30
                                                    4                    Bet Against          Foxy Boxy                    14.5   £50




                •   Only one execution unit can work on this data. It is “owned” by the Actor.
                •   No interleaved/inconsistent updates.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / COMMUNICATIONS.

                                                    • Each Actor operates on the data it owns as a result of messages
                                                      (operations) sent to it.


                                                    • Each Actor may in turn send more messages to further
                                                      execution units.


                                                    • Message passing has its benefits, but also its costs…




         Can distribute widely, conceptually simple                                   But messages can be lost, arrive out of
         concurrency model, threads can be                                            order, duplicated, corrupted, need
         detached from sessions, messages can be                                      correlation, no system wide consistency or
         batched, easier to take advantage of                                         atomicity, enqueue/dequeue costs, etc.
         asynchronous IO, etc.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / CONSISTENCY.

                                                                                     • No Actor in the system has a complete and
                                                                                       consistent view of the entire system and
                                                                                       there is no strict integrity across units.


                                                                                     • Each only responsible for its individual view
                                                                                       of the world. These chunks of reality define
                                                                                       the boundaries of consistency.


                                                                                     • Ultimately full system wide consistency is
                                                                                       desirable but at any instance in time, global
                                                                                       consistency may vary. That is - global
                                                                                       consistency is weak and achieved only
                                                                                       eventually.


                                                                                     • When something inconsistent is found,
                                                                                       explicit correcting actions need to be taken.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / CONSISTENCY.
                                                     Bets
           Exposure &
                                                     Bet ID                Type                 Runner                        Odds      Stake
           Bet Management
                                                     1                     Bet For              Field Commander               12.5      £10


                                                     Matches
                                                     Bet ID          Matched Bet ID            Matched Odds      Matched Stake
                                                     1               5                         12.5              £5



                                                      Unmatched Bets
           Matching &                                 Bet ID        Type           Runner                 Odds        Unmatched Stake
           Market View
                                                      1             Bet For        Field Commander        12.5        £5




                                                                                          Example: These must add up - eventually


      •   Data exists under two Actors control, but no explicit consistency.
      •   Don’t become inconsistent in the first place. State and operations must not be lost,
          corrupted, duplicated, etc. But if something does, take explicit compensating action.

CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / ATOMICITY.
       • Each operation sent to an Actor defines
         the scope of a transaction. The
         instructions that the operation performs
         is defined by the deterministic function
         that it executes.


       • Receipt and journaling of that operation
         defines the success of a transaction.
         The instructions need not be executed,
         only captured.


       • In most case, transactions across
         Actors require explicit compensating
         logic.
       • Would be nice to have one Actor and
         avoid spanning transactions. Not
         practical though.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
The edit can’t complete, the
         SOLUTION / ATOMICITY.                                                                                    edit work done so far must be
                                                                                                                     “rolled back” – manually.


                                 Place Bet                        Place Bet                   Edit Bet

     Exposure &
     Bet Management                                                                                                                      Bet A
                                     Bet A                       Bet A                          Bet A                     Bet A       (Complete,
                               (Incomplete Place)              (Complete)            (Complete, Incomplete Edit)       (Complete)   Incomplete Edit)



                                       Match Bet                                                      Match Bet

     Exposure &
     Bet Management

                                                                               Bet B                    Bet B
                                                                         (Incomplete Place)           (Complete)
                                                                                Match Bet

                                                         Bet Unmatched                        Bet Matched              Bet Already Matched

     Matching &                                                                                       Bet Matched
     Market View
                                                                                           Bet A
                                                   Bet A                                 (Matched)                    Bet A
                                                (Unmatched)                                                         (Matched)
                                                                                                  Bet B
                                                                                                (Matched)



CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / WHEN THINGS GO WRONG.

                                                 • Highly distributed architecture allows for partial failures and
                                                   disruptions.
                                                 • Large chunks of the system can fail and the system as a whole
                                                   will keep running.


                                                 • Durable state and message reliability means system stabilises
                                                   eventually in the event of a failure.




                     Design isn’t overly fussy. “Simple” design important.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / RELIABILITY (STATE).

                                                                                     • Actor’s inbox turned into a journal. State
                                                                                       persistence provided by logging all
                                                                                       messages.


                                                                                     • Replay of journal restores state. Simple ☺
                             Logger



                                                                                     • All functions following the log must be
                             Exposure &                                                deterministic so under replay everything is
                             Bet Management
                                                                                       restored to exactly how it was.


                                                                                     • Disk shared between nodes in the event of a
                                                                                       full node failure.


                                                                                     • Adding check pointing reduces replay time
                                                                                       and prevents log exhaustion.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / RELIABILITY (MESSAGING).

                                                                                     • The log also serves as the basis for reliable
                                                                                       messaging.


                                                                                     • Journal replay also restores the state of
                                                                                       message counters along with application
                             Logger
    Conversations                                                                      state.


                             Exposure &                                              • These message counters (or conversations)
                             Bet Management
                                                                                       are maintained for each sending and
                                                                                       receiving pair.


                                                                                     • Using the counters, lost messages can be
                                                                                       detected, duplicate messages can be
                                                                                       removed and in doubt messages can be
                                                                                       retried safely.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / RELIABILITY (MESSAGING).
                                                     Conversation                            Conversation
                                                     Receive: 23                             Receive: 233
                                                     Send: 2166                              Send: 84


                                                                                                                             234




                                                         24

          2166
                                                               Conversations are between                                    84
                                                                     logical entities
                                                                                                                                   Conversation
                                                                                                                                   Receive: 83
                                                                                                                                   Send: 234
    Conversation
    Receive: 2165
    Send: 24


                                                                580
                                                                                                                  Conversation
                                                                                                                  Receive: 153
                                                                                                                  Send: 580
                           Conversation
                           Receive: 579
                           Send: 154


                                                                                                            154

CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / DEPLOYMENT.

                              Logger                                                                                    Logger




                Exposure &             Exposure &                                                         Exposure &
                Bet Management         Bet Management                                                     Bet Management




                              Logger
                                                                                                                        Logger




                Matching &
                Market View                                                                               Matching &             Matching &
                                                                                                          Market View            Market View




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / HIGH AVAILABILITY.

                                                                                     • Log replay means faults are tolerated…
                                                                                       slowly.
                                                                                     • Need fast(er) recovery.


                                                                                     • Two flavours of HA – catastrophic and fast.
                                                                                     • Need a solution for both.
                                                                                     • We need a back up ready to go, but if both
                                                                                       “disappear” then all is not lost.


                                                                                     • Lots of different ways to do this, but no
                                                                                       perfect solution.


                                                                                     • We tried various ways – about 8. Mostly well
                                                                                       established methods.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / CATASTROPHIC FAILURES
         (1. LOG REPLAY).



                 Failed Actors                                                                            Recovering Actors
                   Failed Units                                                                            Recovering Units




   •   Conceptually simple.
   •   Disk logging fast enough.
   •   Survives most problems – eventually.
   •   Slow recovery.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / CATASTROPHIC FAILURES
         (2. UPSTREAM REPLAY).

                          Upstream Actor                           Upstream Actor                          Upstream Actor




                      Failed Actors                                                                       • Potentially fast, no need for slow
                                                                 Recovering Actors
                         Fed Unit                                   Fed Unit                                logging on “hot market” units.
                                                                                                          • Very complex slow recovery.
                                                                                                          • Problem if upstream actor is also
                                                                                                            down.
                                                                                                          • Still need to log somewhere.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / CATASTROPHIC FAILURES
         (3. MULTI-ORDER MIRRORING).




                Failed Actors                                      Failed Actors                          Recovering Actors
                  Failed Units                                       Failed Units                          Recovering Units




                                                                             • Appears simple, but can be tricky.
                                                                             • Slow.
                                                                             • Won’t survive high multi-order failures.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / FAST FAILURES
         (4. STATE MIRRORING).




                   Hot Actor                           Periodic check point of state deltas               Warm Actor




         • Appears simple.
         • Somewhat slow.
         • Reintroducing a failed node can be
           tricky.
         • Synergy with logging (check pointing)
           mechanism for catastrophic failures.

CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / FAST FAILURES
         (5. LOG TAILING).




                                                                                                          Continuous “recovery”

                   Hot Actor                                                                                 Warm Actor




   • Conceptually simple.
   • Synergy with logging mechanism for
     catastrophic failures.
   • Needs shared disk.



CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / FAST FAILURES
         (6. SIMULTANEOUS DELIVERY).




                                                              Reliable, ordered multicast

                   Hot Actor                                                                              Warm Actor




                               • Slow and tricky.
                               • No need for shared disk.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / FAST FAILURES
         (7. RELAYING).




                   Hot Actor                                                                               Warm Actor




           /dev/null
                                                                           •   Conceptually simple.
                                                                           •   No need for shared disk.
                                                                           •   Throughput not affected.
                                                                           •   Though increases latency.


CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / FAST FAILURES
         (8. LOCK STEPPING).




                                                                      Lock Stepped Actor




         • Off the shelf solution (NonStop, Stratus, Qumranet, etc).
         • Specialised.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
SOLUTION / LOG TAILING.




             • Best compromise.
             • Simple to understand and implement.
             • Catches both catastrophic and fast failure requirements.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
RESULTS.
    • 70K TPS (hot market throughput test at Sun Solution Centre, Manchester, England).
        – Single biggest cost, by far, was serialization on and off network and disk.
    • 70K TPS on a single market. Potentially millions per second across multiple markets (i.e.
      instruments).


        Results
        Load Injectors            “Account Controllers”           “Market Controllers”           Throughput    Latency
        2                         2                               1                              29,950 TPS    250 ms
        3                         3                               1                              73,370 TPS    550 ms
        6                         5                               2                              136,150 TPS   679 ms
        Machines Specification:
        2 x Dual Core 2Ghz AMD Opteron Processor
        8GB Memory
        Copper Gbit Network
        Red Hat Enterprise Linux 4 O/S
        Java 1.5 VM
        Sun 3510 FC Array Storage



     • “Lite” (Production) version passed testing, being integrated.
         – Scaled up instead of out and integrated with “classic” Oracle ETE.



CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
FLYWHEEL LITE.

                                                                              • Production version of Flywheel.
                                                                              • Demanding integration challenges.


                                                                              • Simplified to work on single node.
                                                                                  – Advanced journaling.
                                                                                  – Less network hops.
                                                                                  – Optimization opportunities.
                                                                              • Many advances.
                                                                                 – Algorithm refinement.
                                                                                 – Improved parallelism.
                                                                                 – Improved journaling technology.



                                                       Slowed by bridge to “classic” ETE.

                                          Removal of bridge indicates 80K TPS at sub 100ms.



CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                     • Betfair already provides a number of
                                                                                       financial bets.


                                                                                     • Low(ish) take up.


                                                                                     • Big potential market


                                                                                     • Acquired an understanding of how to cope
                                                                                       with high volume/low latency system from
                                                                                       Sports and Games exchanges


                                                                                     • Looking for areas to diversify into




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                     • Recognised an opportunity and launched
                                                                                       Tradefair.


                                                                                     • “Betfair for Financials rather than sport”.


                                                                                     • Retail focused - compete on value to
                                                                                       customers.


                                                                                     • Just starting up now.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.


                                                                                                          Betfair’s Contribution


                                                                                                                  Cash.

                                                                                                                 People.

                                                                                                              Infrastructure.

                                                                                                                    …




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

          And a really fast exchange system.


          Flywheel technology the key enabler for entry into this market.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
FROM BETFAIR TO TRADEFAIR.




                                                                    Flywheel Lite




                                                                         Pipelines




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                    • Betfair – historically customers tolerant of
                                                                                      latency.


                                                                                    • Now expect financial markets quality of
                                                                                      service.


                                                                                    • Cannot launch Tradefair with relaxed
                                                                                      latency requirements.


                                                                                           – Low latency.
                                                                                           – Consistent latency.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                     • Tradefair


                                                                                            – Customers demand consistent latency.

                                                                                            – Standard deviation down to less than
                                                                                              5 msec under load.

                                                                                            – But need to preserve Flywheel level
                                                                                              throughput.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                  • Solutions – technical


                                                                                         – Non disk journaling.

                                                                                         – GC tuning.

                                                                                         – Heavy abstraction avoidance (data kept
                                                                                           as plain bytes).

                                                                                         – Throughput throttling.

                                                                                         – Smarter buffering.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                 • Can buy better latency (to a degree)


                                                                                        – Bigger servers.

                                                                                        – Faster networks.

                                                                                        – Better storage (avoiding spinning
                                                                                          media).

                                                                                        – Still need to keep costs down to avoid
                                                                                          damaging customer value.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                  • Betfair : Customer Liability Management
                                                                                    (Exposure).


                                                                                         – Simple, fixed one off calculation cost.

                                                                                         – Very easy to optimise.

                                                                                         – Some specialisation around order type.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                               • Tradefair: Customer Liability Management
                                                                                 (Exposure).


                                                                                      – For binaries – same as Betfair (exactly).

                                                                                      – For spreads – more complicated.

                                                                                                 Continuous update.
                                                                                                 Driven by market.
                                                                                                 More order types.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                 • Solution: Liability Management.


                                                                                       – Not actually the bottleneck for
                                                                                         throughput in Flywheel architecture.

                                                                                       – Number of nice algorithmic workarounds.

                                                                                                  Optimise update graph.
                                                                                                  Optimise actual calculation.
                                                                                                  Avoid broad distribution of updates.
                                                                                                  Core Flywheel patterns give solution
                                                                                                  if ever does become overall
                                                                                                  bottleneck.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                           • Betfair: Bet matching.


                                                                                                  – Large number of market types.

                                                                                                  – A large number of markets.

                                                                                                  – Straight forward order types –
                                                                                                    immediate execution, persist until
                                                                                                    market suspended or order
                                                                                                    modified.

                                                                                                  – Already well optimised without
                                                                                                    getting into exotic technologies.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                         • Tradefair: Order matching


                                                                                                – Small number of market types (in
                                                                                                  terms of business logic).

                                                                                                – Smaller number of markets, but
                                                                                                  more consistent throughput.

                                                                                                – Large number of different order
                                                                                                  types (time sensitive, conditional,
                                                                                                  immediate, lapsable).

                                                                                                – Need for immediate settlement.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                          • Solution:
                                                                                             – Same architecture, specialised
                                                                                               business logic
                                                                                             – No significant modifications to
                                                                                               underlying framework




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                           • Data distribution: Betfair (historically).


                                                                                                  – Pull website.

                                                                                                  – SOAP API.

                                                                                                  – Restricted granularity of updates.

                                                                                                  – Diversification to new media like
                                                                                                    mobile phones still largely same
                                                                                                    technology/principles.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                        • Data distribution: Tradefair.


                                                                                               – Push website.

                                                                                               – Pushed Data.

                                                                                               – Standard financials API (FIX).

                                                                                               – Tick by tick granularity.

                                                                                               – Transport reliability




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
TRADEFAIR.

                                                                                       • Solution.


                                                                                             – Flywheel inherently message driven.

                                                                                             – Need series of adapters to translate
                                                                                               internal and external messages.

                                                                                             – Still a latency minimisation and
                                                                                               consistency problem – core
                                                                                               technology can be reused for this.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
FURTHER WORK.

                                                                                     • Geographic Separation.
                                                                                     • Regulation.
                                                                                     • Generality.
                                                                                     • Latency.
                                                                                     • HA.
                                                                                     • Fault tolerance.
                                                                                     • Evolution.
                                                                                     • Integration.
                                                                                     • Complexity.
                                                                                     • Hardware.




          More importantly: Deploy across Betfair and Tradefair.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
END.




CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited

Weitere ähnliche Inhalte

Andere mochten auch

Spy v Spy - Treachery in the Dev/Ops Trenches
Spy v Spy - Treachery in the Dev/Ops TrenchesSpy v Spy - Treachery in the Dev/Ops Trenches
Spy v Spy - Treachery in the Dev/Ops Trenchesbloodredsun
 
Betfair + Couchbase
Betfair + CouchbaseBetfair + Couchbase
Betfair + Couchbasebloodredsun
 
How to Sell Social Media to the C Suite _ Shashi Bellamkonda
How to Sell Social Media to the C Suite _ Shashi BellamkondaHow to Sell Social Media to the C Suite _ Shashi Bellamkonda
How to Sell Social Media to the C Suite _ Shashi BellamkondaShashi Bellamkonda
 
TRANSICION TERRENO
TRANSICION TERRENOTRANSICION TERRENO
TRANSICION TERRENOguest0ea344
 
How2 Start Ocw
How2 Start OcwHow2 Start Ocw
How2 Start OcwTerri Bays
 
My Presentation for PYP2013
My Presentation for PYP2013My Presentation for PYP2013
My Presentation for PYP2013Michael Street
 
Exercícios de Trigonometria Resolvidos
Exercícios de Trigonometria ResolvidosExercícios de Trigonometria Resolvidos
Exercícios de Trigonometria ResolvidosFlaber Bertochi
 
Satio手机
Satio手机Satio手机
Satio手机Liu Xing
 
IA, UX and SEO
IA, UX and SEOIA, UX and SEO
IA, UX and SEOIan Lurie
 
Joe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand DwrJoe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand Dwrdeimos
 
The new framework
The new frameworkThe new framework
The new frameworkiansillett
 
Newcomers Breakfast
Newcomers BreakfastNewcomers Breakfast
Newcomers BreakfastTerri Bays
 
Realtime communication over a dual stack network
Realtime communication over a dual stack networkRealtime communication over a dual stack network
Realtime communication over a dual stack networkOlle E Johansson
 
長尾理論
長尾理論長尾理論
長尾理論maomao
 
Java Script
Java ScriptJava Script
Java ScriptLiu Xing
 
Imagenes Curiosas
Imagenes CuriosasImagenes Curiosas
Imagenes CuriosasDescojonate
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitRick Umali
 

Andere mochten auch (20)

Search engines, SEO and SEM
Search engines, SEO and SEMSearch engines, SEO and SEM
Search engines, SEO and SEM
 
Spy v Spy - Treachery in the Dev/Ops Trenches
Spy v Spy - Treachery in the Dev/Ops TrenchesSpy v Spy - Treachery in the Dev/Ops Trenches
Spy v Spy - Treachery in the Dev/Ops Trenches
 
Mis11e ch02
Mis11e ch02Mis11e ch02
Mis11e ch02
 
Betfair + Couchbase
Betfair + CouchbaseBetfair + Couchbase
Betfair + Couchbase
 
How to Sell Social Media to the C Suite _ Shashi Bellamkonda
How to Sell Social Media to the C Suite _ Shashi BellamkondaHow to Sell Social Media to the C Suite _ Shashi Bellamkonda
How to Sell Social Media to the C Suite _ Shashi Bellamkonda
 
TRANSICION TERRENO
TRANSICION TERRENOTRANSICION TERRENO
TRANSICION TERRENO
 
How2 Start Ocw
How2 Start OcwHow2 Start Ocw
How2 Start Ocw
 
My Presentation for PYP2013
My Presentation for PYP2013My Presentation for PYP2013
My Presentation for PYP2013
 
Exercícios de Trigonometria Resolvidos
Exercícios de Trigonometria ResolvidosExercícios de Trigonometria Resolvidos
Exercícios de Trigonometria Resolvidos
 
Satio手机
Satio手机Satio手机
Satio手机
 
Usagility
UsagilityUsagility
Usagility
 
IA, UX and SEO
IA, UX and SEOIA, UX and SEO
IA, UX and SEO
 
Joe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand DwrJoe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand Dwr
 
The new framework
The new frameworkThe new framework
The new framework
 
Newcomers Breakfast
Newcomers BreakfastNewcomers Breakfast
Newcomers Breakfast
 
Realtime communication over a dual stack network
Realtime communication over a dual stack networkRealtime communication over a dual stack network
Realtime communication over a dual stack network
 
長尾理論
長尾理論長尾理論
長尾理論
 
Java Script
Java ScriptJava Script
Java Script
 
Imagenes Curiosas
Imagenes CuriosasImagenes Curiosas
Imagenes Curiosas
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 

Mehr von deimos

Aspect Orientated Programming in Ruby
Aspect Orientated Programming in RubyAspect Orientated Programming in Ruby
Aspect Orientated Programming in Rubydeimos
 
Randy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural PrinciplesRandy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural Principlesdeimos
 
Remy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQueryRemy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQuerydeimos
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvmdeimos
 
Aslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec BddAslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec Bdddeimos
 
Venkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In GroovyVenkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In Groovydeimos
 
Venkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic LanguagesVenkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic Languagesdeimos
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfacesdeimos
 
Tim Mackinnon Agile And Beyond
Tim Mackinnon Agile And BeyondTim Mackinnon Agile And Beyond
Tim Mackinnon Agile And Beyonddeimos
 
Steve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And SerendipitySteve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And Serendipitydeimos
 
Stefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The WebStefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The Webdeimos
 
Stefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To RestStefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To Restdeimos
 
Rod Johnson Cathedral
Rod Johnson CathedralRod Johnson Cathedral
Rod Johnson Cathedraldeimos
 
Mike Stolz Dramatic Scalability
Mike Stolz Dramatic ScalabilityMike Stolz Dramatic Scalability
Mike Stolz Dramatic Scalabilitydeimos
 
Pete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two SystemsPete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two Systemsdeimos
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registrydeimos
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platformdeimos
 
Neal Gafter Java Evolution
Neal Gafter Java EvolutionNeal Gafter Java Evolution
Neal Gafter Java Evolutiondeimos
 
Markus Voelter Textual DSLs
Markus Voelter Textual DSLsMarkus Voelter Textual DSLs
Markus Voelter Textual DSLsdeimos
 
Marc Evers People Vs Process Beyond Agile
Marc Evers People Vs Process Beyond AgileMarc Evers People Vs Process Beyond Agile
Marc Evers People Vs Process Beyond Agiledeimos
 

Mehr von deimos (20)

Aspect Orientated Programming in Ruby
Aspect Orientated Programming in RubyAspect Orientated Programming in Ruby
Aspect Orientated Programming in Ruby
 
Randy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural PrinciplesRandy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural Principles
 
Remy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQueryRemy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQuery
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvm
 
Aslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec BddAslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec Bdd
 
Venkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In GroovyVenkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In Groovy
 
Venkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic LanguagesVenkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic Languages
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfaces
 
Tim Mackinnon Agile And Beyond
Tim Mackinnon Agile And BeyondTim Mackinnon Agile And Beyond
Tim Mackinnon Agile And Beyond
 
Steve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And SerendipitySteve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And Serendipity
 
Stefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The WebStefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The Web
 
Stefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To RestStefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To Rest
 
Rod Johnson Cathedral
Rod Johnson CathedralRod Johnson Cathedral
Rod Johnson Cathedral
 
Mike Stolz Dramatic Scalability
Mike Stolz Dramatic ScalabilityMike Stolz Dramatic Scalability
Mike Stolz Dramatic Scalability
 
Pete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two SystemsPete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two Systems
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registry
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platform
 
Neal Gafter Java Evolution
Neal Gafter Java EvolutionNeal Gafter Java Evolution
Neal Gafter Java Evolution
 
Markus Voelter Textual DSLs
Markus Voelter Textual DSLsMarkus Voelter Textual DSLs
Markus Voelter Textual DSLs
 
Marc Evers People Vs Process Beyond Agile
Marc Evers People Vs Process Beyond AgileMarc Evers People Vs Process Beyond Agile
Marc Evers People Vs Process Beyond Agile
 

Kürzlich hochgeladen

Digital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfDigital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfJos Voskuil
 
Kenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby AfricaKenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby Africaictsugar
 
TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024Adnet Communications
 
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCRashishs7044
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCRashishs7044
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCRashishs7044
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMVoces Mineras
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Riya Pathan
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCRashishs7044
 
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCRashishs7044
 
Buy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy Verified Accounts
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Pereraictsugar
 
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...ssuserf63bd7
 
Guide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFGuide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFChandresh Chudasama
 
Annual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesAnnual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesKeppelCorporation
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Servicecallgirls2057
 

Kürzlich hochgeladen (20)

Digital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfDigital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdf
 
Kenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby AfricaKenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby Africa
 
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
 
TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024
 
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
 
Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQM
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
 
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
 
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
 
Buy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail Accounts
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Perera
 
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...
 
Guide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFGuide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDF
 
Annual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesAnnual General Meeting Presentation Slides
Annual General Meeting Presentation Slides
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
 
Call Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North GoaCall Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North Goa
 

Matt Youill Betfair

  • 1. FROM BETTING TO GAMING TO TRADEFAIR Matt Youill, Chief Technologist, Betfair Asher Glynn, Primary Initiatives Manager, Betfair QCon, London UK, March 2008 CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 2. INDUSTRY / TRADITIONAL BOOKMAKING. • Bets are only made between the customer and the Bookmaker. • Bookmaker sets odds (prices) and factors in a margin. Traditional Bookmakers are still major players in the gaming industry. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 3. INDUSTRY / BETFAIR EXCHANGE. • New bookmaker Betfair appears in 2000. Defined the Betting Exchange concept. • Customer’s bets matched between themselves. • Customers set the odds (prices). • An exchange has “perfect” risk management and therefore, a lower margin. • Commission on winnings. • Prices around 20% better than Traditional Bookmakers. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 4. INDUSTRY / BETFAIR CASINO, POKER AND GAMES. • Complete portfolio of gaming products complements the exchange. • Strategically key for Betfair. • Share Betfair’s principle of fairness such as the “Zero edge” Casino. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 5. INDUSTRY / BETFAIR. • Betfair operates a betting exchange, games exchange, poker room, and casino. • Annual revenues in excess of £200 million. • Over 1,000,000 registered users. • Over 1500 employees in offices globally. • 5 billion page views/week. • Almost half of all global traffic to gambling sites comes to Betfair. • £2,000 deposited every minute. • World’s leading betting exchange. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 6. INDUSTRY / TRADEFAIR. • The Tradefair exchange, a subsidiary of Betfair, launched in late 2007. • Currently offering financial binaries and spread betting. • Accessible, available, transparent retail channel. • Commission on profits. • Prices very closely reflect the underlying market. • Very low cost trading direct to customers. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 7. CHALLENGE / TRANSACTION PROCESSING. • Numerous challenges when delivering these products directly to customers over retail channels. • Security on the wild west web. • Low capability devices - browsers, mobiles, etc. • Channel predictability. • And so on. • State management , particularly the changing of and delivery of state (a.k.a transaction processing) very difficult. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 8. CHALLENGE / BETTING EXCHANGE. • The exchanges have very large capacity requirements. • Currently, up to 1000 transactions per second. • Desired objective of 50,000 low cost transactions per second. • Plus increased reliability, maintainability, etc. • The 100X project formed to achieve these goals. • A transaction = a bet placement, a cancel or an edit. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 9. CHALLENGE / EXCHANGE TRANSACTION ENGINE. • The Betfair exchange’s “flux capacitor” is the Exchange Transaction Engine (ETE). • It provides 4 key functions: • Exposure: Validates and stores bet orders, reserves customer funds. • Matching: Matches customer’s bets and reports the result. • Bet Management: Allows customers to view the status of their bets. • Market View: Allows customers to view a summary of all the bets placed on an event. • Most have parallels in financials. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 10. CHALLENGE / EXCHANGE TRANSACTION ENGINE. Exposure Bet Market Management View Matching CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 11. CHALLENGE / EXCHANGE TRANSACTION ENGINE. • Currently implemented in PL/SQL on a single Oracle instance. • Rated as one of top 5 “hottest” Oracle databases in the world. • Since Betfair was founded it has been a constant struggle to satisfy capacity demands. • Why?... Growing pains aside, it is because Betfair’s rules of fairness present a challenge when scaling the Matching component of the ETE. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 12. CHALLENGE / MATCHING. • Betfair has two key business rules… Best Execution (Best customer value) Each bet placed is matched against opposing bets in order of descending odds. First come, First served (Fairness for all) The first bet placed is the first matched exclusive of others. • Means everything processed serially. • There is an unavoidable traffic jam in the business rules. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 13. CHALLENGE / MATCHING. • Rules only apply per event. • Means system can be scaled by processing each event in parallel. (Similar to the concurrent execution of trades on financial instruments). • But… • The nature of big events, particularly horse racing, is that they are short lived and start times rarely coincide. (Unlike the more evenly spread activity on financial exchanges). • Over 75% of betting activity at any one time is on a single Betfair event – the “hot market”. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 14. CHALLENGE / EXPOSURE AND BET MANAGEMENT. • Exposure and bet management are less of a challenge as they occur on a per customer (account) basis. • With activity roughly evenly spread across accounts, and peak activity on individual accounts relatively low, it’s possible to simply partition by account. • Parallelisation, partitioning and distribution provides sufficient capacity. • Except, of course, in the case of a big individual users. But none of them are that big…yet. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 15. CHALLENGE / MARKET VIEW. • The Market View or the view of the odds and stakes currently available on an event is challenging but in a different way. • Every transaction will potentially change the view of a market. • Hence, every transaction requires the new view to be delivered to customers. • This is a lot of information that needs to go to a lot of people many times every second. • Multicasting scales effectively but in the world of the web it is harder requiring manual polling, AJAX, Comet, etc. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 16. APPROACH / THE PIONEERS. • Many initiatives tried before. • Approached as optimisations or evolutions of the existing engine. • Optimizations - hardware upgrades, index tuning, schema reorganisations, etc. • Evolutions – product solutions, functional partitioning, asynchronicity, etc. • Essential yet modest gains. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 17. APPROACH / 100X PROGRAMME. “100 times (100X) more transactions per second” “Infinite capacity at zero cost” • At the time of initiation (500 TPS -> 50,000 TPS) • 10,000% target. • Challenge existed for many years, well defined. Solution less so ☺. Phases Investigation Had this problem or anything like it been solved before? Research & Design Sketch and elaborate various architectures. Proof of Concept Multiple Vendors including Betfair Engineering. Build, test and compare. Integration How to get into production? What changes and compromises needed? Build and Deploy Build the “Lite” version and plug it into the live system. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 18. SOLUTION / CONCURRENCY (ISOLATION). • Each of the major functions in the ETE require exclusive access to either an account or event (market). • Rather than client sessions acquiring and releasing locks on particular pieces of data, each instance of an entity is assigned to a single execution unit (i.e. Actor). Unit A may own Account 123, or unit B may own Market 456 for example. • With execution units tied to individual entities, access is inherently serialised and “transactions” are isolated from one another. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 19. SOLUTION / CONCURRENCY (ISOLATION). Exposure & Exposure & Exposure & Bet Management Bet Management Bet Management Matching & Matching & Market View Market View CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 20. SOLUTION / CONCURRENCY (ISOLATION). Brokering & Brokering & Brokering & Order Management Order Management Order Management Matching & Matching & Order Book Order Book CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 21. SOLUTION / CONCURRENCY (ISOLATION). Account Exposure & Account ID Funds Exposure Bet Management 1 £1,000 £735 Bets Bet ID Type Runner Odds Stake 1 Bet For Field Commander 12.5 £10 2 Bet For Wingate Street 6.8 £20 3 Bet For Keyton Grace 19.5 £30 4 Bet Against Foxy Boxy 14.5 £50 • Only one execution unit can work on this data. It is “owned” by the Actor. • No interleaved/inconsistent updates. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 22. SOLUTION / COMMUNICATIONS. • Each Actor operates on the data it owns as a result of messages (operations) sent to it. • Each Actor may in turn send more messages to further execution units. • Message passing has its benefits, but also its costs… Can distribute widely, conceptually simple But messages can be lost, arrive out of concurrency model, threads can be order, duplicated, corrupted, need detached from sessions, messages can be correlation, no system wide consistency or batched, easier to take advantage of atomicity, enqueue/dequeue costs, etc. asynchronous IO, etc. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 23. SOLUTION / CONSISTENCY. • No Actor in the system has a complete and consistent view of the entire system and there is no strict integrity across units. • Each only responsible for its individual view of the world. These chunks of reality define the boundaries of consistency. • Ultimately full system wide consistency is desirable but at any instance in time, global consistency may vary. That is - global consistency is weak and achieved only eventually. • When something inconsistent is found, explicit correcting actions need to be taken. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 24. SOLUTION / CONSISTENCY. Bets Exposure & Bet ID Type Runner Odds Stake Bet Management 1 Bet For Field Commander 12.5 £10 Matches Bet ID Matched Bet ID Matched Odds Matched Stake 1 5 12.5 £5 Unmatched Bets Matching & Bet ID Type Runner Odds Unmatched Stake Market View 1 Bet For Field Commander 12.5 £5 Example: These must add up - eventually • Data exists under two Actors control, but no explicit consistency. • Don’t become inconsistent in the first place. State and operations must not be lost, corrupted, duplicated, etc. But if something does, take explicit compensating action. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 25. SOLUTION / ATOMICITY. • Each operation sent to an Actor defines the scope of a transaction. The instructions that the operation performs is defined by the deterministic function that it executes. • Receipt and journaling of that operation defines the success of a transaction. The instructions need not be executed, only captured. • In most case, transactions across Actors require explicit compensating logic. • Would be nice to have one Actor and avoid spanning transactions. Not practical though. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 26. The edit can’t complete, the SOLUTION / ATOMICITY. edit work done so far must be “rolled back” – manually. Place Bet Place Bet Edit Bet Exposure & Bet Management Bet A Bet A Bet A Bet A Bet A (Complete, (Incomplete Place) (Complete) (Complete, Incomplete Edit) (Complete) Incomplete Edit) Match Bet Match Bet Exposure & Bet Management Bet B Bet B (Incomplete Place) (Complete) Match Bet Bet Unmatched Bet Matched Bet Already Matched Matching & Bet Matched Market View Bet A Bet A (Matched) Bet A (Unmatched) (Matched) Bet B (Matched) CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 27. SOLUTION / WHEN THINGS GO WRONG. • Highly distributed architecture allows for partial failures and disruptions. • Large chunks of the system can fail and the system as a whole will keep running. • Durable state and message reliability means system stabilises eventually in the event of a failure. Design isn’t overly fussy. “Simple” design important. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 28. SOLUTION / RELIABILITY (STATE). • Actor’s inbox turned into a journal. State persistence provided by logging all messages. • Replay of journal restores state. Simple ☺ Logger • All functions following the log must be Exposure & deterministic so under replay everything is Bet Management restored to exactly how it was. • Disk shared between nodes in the event of a full node failure. • Adding check pointing reduces replay time and prevents log exhaustion. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 29. SOLUTION / RELIABILITY (MESSAGING). • The log also serves as the basis for reliable messaging. • Journal replay also restores the state of message counters along with application Logger Conversations state. Exposure & • These message counters (or conversations) Bet Management are maintained for each sending and receiving pair. • Using the counters, lost messages can be detected, duplicate messages can be removed and in doubt messages can be retried safely. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 30. SOLUTION / RELIABILITY (MESSAGING). Conversation Conversation Receive: 23 Receive: 233 Send: 2166 Send: 84 234 24 2166 Conversations are between 84 logical entities Conversation Receive: 83 Send: 234 Conversation Receive: 2165 Send: 24 580 Conversation Receive: 153 Send: 580 Conversation Receive: 579 Send: 154 154 CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 31. SOLUTION / DEPLOYMENT. Logger Logger Exposure & Exposure & Exposure & Bet Management Bet Management Bet Management Logger Logger Matching & Market View Matching & Matching & Market View Market View CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 32. SOLUTION / HIGH AVAILABILITY. • Log replay means faults are tolerated… slowly. • Need fast(er) recovery. • Two flavours of HA – catastrophic and fast. • Need a solution for both. • We need a back up ready to go, but if both “disappear” then all is not lost. • Lots of different ways to do this, but no perfect solution. • We tried various ways – about 8. Mostly well established methods. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 33. SOLUTION / CATASTROPHIC FAILURES (1. LOG REPLAY). Failed Actors Recovering Actors Failed Units Recovering Units • Conceptually simple. • Disk logging fast enough. • Survives most problems – eventually. • Slow recovery. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 34. SOLUTION / CATASTROPHIC FAILURES (2. UPSTREAM REPLAY). Upstream Actor Upstream Actor Upstream Actor Failed Actors • Potentially fast, no need for slow Recovering Actors Fed Unit Fed Unit logging on “hot market” units. • Very complex slow recovery. • Problem if upstream actor is also down. • Still need to log somewhere. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 35. SOLUTION / CATASTROPHIC FAILURES (3. MULTI-ORDER MIRRORING). Failed Actors Failed Actors Recovering Actors Failed Units Failed Units Recovering Units • Appears simple, but can be tricky. • Slow. • Won’t survive high multi-order failures. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 36. SOLUTION / FAST FAILURES (4. STATE MIRRORING). Hot Actor Periodic check point of state deltas Warm Actor • Appears simple. • Somewhat slow. • Reintroducing a failed node can be tricky. • Synergy with logging (check pointing) mechanism for catastrophic failures. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 37. SOLUTION / FAST FAILURES (5. LOG TAILING). Continuous “recovery” Hot Actor Warm Actor • Conceptually simple. • Synergy with logging mechanism for catastrophic failures. • Needs shared disk. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 38. SOLUTION / FAST FAILURES (6. SIMULTANEOUS DELIVERY). Reliable, ordered multicast Hot Actor Warm Actor • Slow and tricky. • No need for shared disk. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 39. SOLUTION / FAST FAILURES (7. RELAYING). Hot Actor Warm Actor /dev/null • Conceptually simple. • No need for shared disk. • Throughput not affected. • Though increases latency. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 40. SOLUTION / FAST FAILURES (8. LOCK STEPPING). Lock Stepped Actor • Off the shelf solution (NonStop, Stratus, Qumranet, etc). • Specialised. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 41. SOLUTION / LOG TAILING. • Best compromise. • Simple to understand and implement. • Catches both catastrophic and fast failure requirements. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 42. RESULTS. • 70K TPS (hot market throughput test at Sun Solution Centre, Manchester, England). – Single biggest cost, by far, was serialization on and off network and disk. • 70K TPS on a single market. Potentially millions per second across multiple markets (i.e. instruments). Results Load Injectors “Account Controllers” “Market Controllers” Throughput Latency 2 2 1 29,950 TPS 250 ms 3 3 1 73,370 TPS 550 ms 6 5 2 136,150 TPS 679 ms Machines Specification: 2 x Dual Core 2Ghz AMD Opteron Processor 8GB Memory Copper Gbit Network Red Hat Enterprise Linux 4 O/S Java 1.5 VM Sun 3510 FC Array Storage • “Lite” (Production) version passed testing, being integrated. – Scaled up instead of out and integrated with “classic” Oracle ETE. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 43. FLYWHEEL LITE. • Production version of Flywheel. • Demanding integration challenges. • Simplified to work on single node. – Advanced journaling. – Less network hops. – Optimization opportunities. • Many advances. – Algorithm refinement. – Improved parallelism. – Improved journaling technology. Slowed by bridge to “classic” ETE. Removal of bridge indicates 80K TPS at sub 100ms. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 44. TRADEFAIR. • Betfair already provides a number of financial bets. • Low(ish) take up. • Big potential market • Acquired an understanding of how to cope with high volume/low latency system from Sports and Games exchanges • Looking for areas to diversify into CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 45. TRADEFAIR. • Recognised an opportunity and launched Tradefair. • “Betfair for Financials rather than sport”. • Retail focused - compete on value to customers. • Just starting up now. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 46. TRADEFAIR. Betfair’s Contribution Cash. People. Infrastructure. … CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 47. TRADEFAIR. And a really fast exchange system. Flywheel technology the key enabler for entry into this market. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 48. FROM BETFAIR TO TRADEFAIR. Flywheel Lite Pipelines CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 49. TRADEFAIR. • Betfair – historically customers tolerant of latency. • Now expect financial markets quality of service. • Cannot launch Tradefair with relaxed latency requirements. – Low latency. – Consistent latency. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 50. TRADEFAIR. • Tradefair – Customers demand consistent latency. – Standard deviation down to less than 5 msec under load. – But need to preserve Flywheel level throughput. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 51. TRADEFAIR. • Solutions – technical – Non disk journaling. – GC tuning. – Heavy abstraction avoidance (data kept as plain bytes). – Throughput throttling. – Smarter buffering. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 52. TRADEFAIR. • Can buy better latency (to a degree) – Bigger servers. – Faster networks. – Better storage (avoiding spinning media). – Still need to keep costs down to avoid damaging customer value. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 53. TRADEFAIR. • Betfair : Customer Liability Management (Exposure). – Simple, fixed one off calculation cost. – Very easy to optimise. – Some specialisation around order type. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 54. TRADEFAIR. • Tradefair: Customer Liability Management (Exposure). – For binaries – same as Betfair (exactly). – For spreads – more complicated. Continuous update. Driven by market. More order types. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 55. TRADEFAIR. • Solution: Liability Management. – Not actually the bottleneck for throughput in Flywheel architecture. – Number of nice algorithmic workarounds. Optimise update graph. Optimise actual calculation. Avoid broad distribution of updates. Core Flywheel patterns give solution if ever does become overall bottleneck. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 56. TRADEFAIR. • Betfair: Bet matching. – Large number of market types. – A large number of markets. – Straight forward order types – immediate execution, persist until market suspended or order modified. – Already well optimised without getting into exotic technologies. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 57. TRADEFAIR. • Tradefair: Order matching – Small number of market types (in terms of business logic). – Smaller number of markets, but more consistent throughput. – Large number of different order types (time sensitive, conditional, immediate, lapsable). – Need for immediate settlement. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 58. TRADEFAIR. • Solution: – Same architecture, specialised business logic – No significant modifications to underlying framework CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 59. TRADEFAIR. • Data distribution: Betfair (historically). – Pull website. – SOAP API. – Restricted granularity of updates. – Diversification to new media like mobile phones still largely same technology/principles. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 60. TRADEFAIR. • Data distribution: Tradefair. – Push website. – Pushed Data. – Standard financials API (FIX). – Tick by tick granularity. – Transport reliability CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 61. TRADEFAIR. • Solution. – Flywheel inherently message driven. – Need series of adapters to translate internal and external messages. – Still a latency minimisation and consistency problem – core technology can be reused for this. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 62. FURTHER WORK. • Geographic Separation. • Regulation. • Generality. • Latency. • HA. • Fault tolerance. • Evolution. • Integration. • Complexity. • Hardware. More importantly: Deploy across Betfair and Tradefair. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited
  • 63. END. CONFIDENTIAL and not for reproduction without prior written consent. © of the Sporting Exchange Limited