Upgrade to Pro — share decks privately, control downloads, hide ads and more …

1M tickets, 50 lang and 35 currencies

Jose
November 22, 2015

1M tickets, 50 lang and 35 currencies

How we scaled-out our platform to serve 1M tickets in 50 lang and 35 different currencies without database hits

Jose

November 22, 2015
Tweet

More Decks by Jose

Other Decks in Technology

Transcript

  1. ~ 1M tickets ~ 50 langs ~ 35 currencies scenario

    ~ legal res. ~ logistic res. ~ high traffic
  2. Redis queues (2) Changed tickets are pushed to the queue

    (LPUSH). (3) Consumer process. RPOPLPUSH allows us to keep queues reliable, if the process fails, the script will recover unprocessed entities. (4) Items are removed from the processing queue.
  3. ~ 1M tickets ~ 50 langs ~ 35 currencies Denormalization

    ~ legal res. ~ logistic res. ~ Event stats
  4. ~ 1M tickets ~ 50 langs ~ 35 currencies Denormalization

    ~ legal res. ~ logistic res. ~ Event stats
  5. cdecimal in Python 2 __init__.py ~ cdecimal has been integrated

    into CPython 3.3, where it supersedes the pure Python version ~ cdecimal shipped with CPython 3.3 is significantly faster for numerical workload than cdecimal-2.3
  6. There are only two hard things in Computer Science: cache

    invalidation and naming things -- Phil Karlton
  7. Cache invalidation TTLs EXPIRE Redis command allows us to set

    timeouts on keys based on event’s date
  8. ~ A distributed RESTful search engine ~ Apache Lucene is

    the search engine lib behind ES Elasticsearch
  9. ~ public data: categories & events ~ private data: purchases,

    users, ... ~ Ticket prices log Elasticsearch: clusters
  10. Next steps ~ Use Redis as an LRU cache allkeys-lru,

    volatile-lru, ... ~ API hitting cached data