We presented our Betclic approach on moving towards a Push event-driven architecture during the Paris Tech Talk meetup, hosted at Google HQ in Paris on 13/01/2014.
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Paris Tech Talk #5: From Pull to Push
1. From Pull to Push
Moving from request-response to event-driven web clients
Paris TechTalk 13/01/2014
2. Agenda
A multi-brand / multi-country / multi business galaxy
A brief technical history
Current technical solution
What’s next? Innovation Day
From Pull to Push!
From Pull to Push/ Paris TechTalk
2
3. A multi-brand / multi-country / multi business galaxy
1/14/2014
From Pull to Push/ Paris TechTalk
3
4. A brief technical history: isolated separated websites
BETCLIC.FR
(VB.Net WebFoms)
BETCLIC.COM
(VB.Net WebFoms)
BETCLIC.IT
(C# MVC)
COMMON
COMMON
COMMON
SPORTSBOOK (PRE LIVE
/ LIVE)
SPORTSBOOK (PRE LIVE
/ LIVE)
SPORTSBOOK (PRE LIVE
/ LIVE)
SPORTSBOOK (PRE LIVE
/ LIVE)
CASINO / LIVE CASINO /
GAMES
CASINO / LIVE CASINO /
GAMES
CASINO / LIVE CASINO /
GAMES / VEGAS
POKER
POKER
EXPEKT.COM
(Java)
TURF
POKER
14/01/2014
POKER MVC
POKER
From Pull to Push/ Paris TechTalk
#4
5. Current technical solution: mutualized shared code
BETCLIC.FR
BETCLIC.COM
BETCLIC.IT
EXPEKT.COM
GLOBAL (REGISTER / PAYMENT / MY ACCOUNT) – (Portable areas)
SPORTSBOOK (PRE LIVE / LIVE) - (ASP.Net MVC4)
POKER - (ASP.Net MVC4)
CASINO / LIVE CASINO / GAMES - (ASP.Net MVC4)
TURF - (ASP.Net
MVC4)
From Pull to Push/ Paris TechTalk
#5
6. Current technical solution: Onion Architecture
For a White-Label strategy
User Interface
Application Services
Domain Services
Domain
Model
From Pull to Push/ Paris TechTalk
#6
7. How do we move forward from there?
• We achieved:
– Global move to ASP.Net MVC / Onion architecture
Now easier to:
Integrate new regulated countries
Change sites’ look and feel
• But we still face the following issues due to the Polling
mechanism:
– Caching and latency: sport data is updated on the web site every 10
sec systematically.
– Scalability: bandwidth and server load
– User Experience could be improved to be more real-time (think sport
events) - bets can be rejected if odd has changed!
From Pull to Push/ Paris TechTalk
7
8. Innovation Day
• Event focused on Innovation
• Dev and Business mixed in small teams, for a 1-day contest
• Make a break in daily work with a fun and exciting event
• Winner: Real-time Sport broadcast
“Instead of polling Sport feed to display results on the Match page, build a
real-time push solution from the server to the clients, with very low latency and
if possible use this solution for odds update in real-time as well.”
From Pull to Push/ Paris TechTalk
8
9. Concept Architecture: Before
3rd Party
~20 sec latency
Latency 300 ms
Refresh every
10 sec average
Cache 2 sec
Cache 5 sec
From Pull to Push/ Paris TechTalk
9
10. Concept Architecture: After
< 1 sec latency
3rd Party
Latency 300 ms
Latency <10 ms
From Pull to Push/ Paris TechTalk
10
11. KPI – Watch of 1 football live for 90 mns for 1 user
Current Website
Push Website
Bandwidth
16 Mo
Bandwidth
50 Ko
Requests
5400 (almost 1
req/sec in average)
Requests
100
Bandwidth economy :
15,950 Mo per user (~99,7% savings)
User economy: less data on Mobile
Less load whatever the traffic = less servers!
12. Why we chose Redis
• Pub-Sub mechanism: an easy way to
broadcast something to all nodes (subscribers)
• Very low latency
• Strong scalability
From Pull to Push/ Paris TechTalk
12
13. PUSH – How it works?
WCF service
WCF routing service
From Pull to Push/ Paris TechTalk
13
14. PUSH – How it works on front side?
From Pull to Push/ Paris TechTalk
14
15. The Future of Push
• Many possible usage for us:
– Sport data update: odds, score boards
– Translation updates
– Technical data update: cache invalidation, realtime configuration changes
– Flash notifications for marketing purpose
From Pull to Push/ Paris TechTalk
15
17. Find out more
• Our Blog:
https://techblog.betclicgroup.com/
Contacts
Frédéric RIVAIN
f.rivain@betclicgroup.com
@FredericRivain
Maxime SANGLAN
m.sanglan@betclicgroup.com
@__MaxS__
From Pull to Push/ Paris TechTalk