$30 off During Our Annual Pro Sale. View Details »

High-Impact refactors keeping the lights on

High-Impact refactors keeping the lights on

First presented at PyConES 2017

Ticketea Engineering

September 23, 2017
Tweet

More Decks by Ticketea Engineering

Other Decks in Programming

Transcript

  1. High-impact
    refactors
    keeping the
    lights on
    @Kartones
    Diego Muñoz

    View Slide

  2. 01.
    What
    02.
    Why
    03.
    How
    04.
    When
    Agenda

    View Slide

  3. What

    View Slide

  4. What

    View Slide

  5. What

    View Slide

  6. Why

    View Slide

  7. Why

    View Slide

  8. Why

    View Slide

  9. How

    View Slide

  10. Mega
    structures
    How

    View Slide

  11. Mega
    structures
    How

    View Slide

  12. DB
    High-frequency
    selling
    How
    CMS
    API
    CRUD
    Current (simplified)
    flow

    View Slide

  13. How
    Extend,
    not modify*
    API
    DB
    High-frequency
    selling
    CRUD
    CMS
    REDIS
    EVENT
    BUS
    EVENT
    BUS
    APU
    *do modify if needed to allow
    extension

    View Slide

  14. Patterns &
    Practices
    - Parallel change
    - Strangler
    How
    API
    DB
    High-frequency
    selling
    CRUD
    CMS
    REDIS
    EVENT
    BUS
    EVENT
    BUS
    APU

    View Slide

  15. How
    API
    DB
    High-frequency
    selling
    CRUD
    CMS
    REDIS
    EVENT
    BUS
    EVENT
    BUS
    APU
    Patterns &
    Practices
    - Event Bus
    - Cursor-based
    - N writers/readers

    View Slide

  16. How
    API
    DB
    High-frequency
    selling
    CRUD
    CMS
    REDIS
    EVENT
    BUS
    EVENT
    BUS
    APU
    Patterns &
    Practices
    - Event Sourcing

    View Slide

  17. How
    API
    DB
    High-frequency
    selling
    CRUD
    CMS
    REDIS
    EVENT
    BUS
    EVENT
    BUS
    APU
    “Build exciting
    things with boring
    nice technologies”
    - Python 3.6
    · Strongly typed (Mypy)
    · Dockerized
    - Redis with LUA
    - AWS Kinesis
    github.com/ticketea/pynesis

    View Slide

  18. When

    View Slide

  19. When
    Continous Iteration
    - No hard deadline
    - Desired: soon :-)

    View Slide

  20. Latest benchmark:
    ~4100 ops/sec
    - Single CPU core, 20k
    tickets, 50k concurrent
    users
    - Attacking internal API
    - Room for optimization
    When

    View Slide

  21. Current status:
    - Free events
    - Paid events on their way
    · Play safe
    (money involved!)
    · Lots of payment methods
    When

    View Slide

  22. Release plan:
    - Now: Hack
    (Special payment method)
    - 1.0: Feature Toggling
    When

    View Slide

  23. Rollout plan
    01. Canary: big free event
    02. Dark launch: on paid events
    03. B/G: Gradual switch
    When

    View Slide

  24. THE END
    Thanks!
    @Kartones

    View Slide