Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

.NET Fest 2017. Anton Moldovan. How do we cook highload microservices at SBTech?

234 views

Published on

In this talk I will explain our way into microservices architecture:
What technology stack we choose and why?
[Stateful/Stateless Services; Cache; Streaming Data; Structure Logging]
How do we use/adopt F# as a primary language and what do we gain?
[DDD; CQRS; ES; Property Based Testing; Dependency Rejection]
How do we test our microservices?
[Integration/Load/Failover Tests]
In addition, I will demo several production problems and solutions to it. Looking forward to seeing you all there!!!

Published in: Education
  • Be the first to comment

.NET Fest 2017. Anton Moldovan. How do we cook highload microservices at SBTech?

  1. 1. How do we cook highload microservices at SBTech by @AntyaDev Kyiv 28.10.2017
  2. 2. genda • What technology stack did we choose and why? [Stateful/Stateless Services; Cache; Streaming Data; Structure Logging] • How do we use/adopt F# as a primary language and what do we gain? [DDD; CQRS; ES; Property Based Testing; Dependency Rejection] • How do we test our microservices? [Integration/Load/Failover Tests]
  3. 3. - One of the biggest provider in sport offering - Supports a lot of regulated markets - About 1000 microservices (200 distinct types) - About 5 datacenters maintained fully by SBTech - About 500 concurrent live events at pick time - Design to settle 1 – 2ml bets per event
  4. 4. Stateless Services
  5. 5. Stateless Services are Wasteful • Stateless services have worked well. Storing the canonical source of truth in the database and horizontally scaling by adding new stateless service instances as needed has been very effective. • The problem is our applications do have state and we are hitting limits where one database doesn’t cut it anymore. In response we’re sharding relational databases or using NoSQL databases. This gives up strong consistency which causes part of the database abstraction to leak into services.
  6. 6. Actor model User 1 User 2 User 3
  7. 7. Cache
  8. 8. Complex Event Processing
  9. 9. Streaming
  10. 10. Streaming • Bridge between datacenters • Production traffic (integration tests) • Metrics, logs • Pick time about 80K logs in sec • Overall volume about 2TB per day
  11. 11. 12:23:10 [INF] Service "loyalty-card-printer" starting up on host 8fd342hkg22u 12:23:11 [INF] Listening on http://8fd342hkg22u.example.com:1234 12:23:20 [INF] Card replacement request received for customer-109972 12:40:55 [INF] Card replacement request received for customer-98048
  12. 12. time=12:23:10, level=INF, service=loyalty-card-printer, host=8fd342hkg22u, activity=started time=12:23:11, level=INF, endpoint=http://8fd342hkg22u.example.com:1234, activity=listening time=12:23:20, level=INF, customer=customers-1099972, activity=replacement time=12:40:55, level=INF, customer=customer-98048, activity=replacement
  13. 13. Microservice Serilog
  14. 14. Microservice Microservice Microservice Microservice Microservice Microservice
  15. 15. Functional programming
  16. 16. LEFT FOLD fold: ('State -> 'Event -> 'State) -> 'State -> 'Event list -> 'State let state = loadEvents(streamId) |> List.fold applyEvent zeroState
  17. 17. (John Hughes, Koen Claessen)

×