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

Gateway - How to bring down our monolith

Gateway - How to bring down our monolith

Talk given during a PHP meetup in Poland. I present here the main problems of the old BlaBlaCar monolith and how we are trying to change.

Benjamin De Bernardi

October 20, 2015
Tweet

More Decks by Benjamin De Bernardi

Other Decks in Technology

Transcript

  1. Benjamin De Bernardi
    Gateway
    How to bring down our monolith

    View Slide

  2. Benjamin De Bernardi
    Web Developer
    @Genes0r

    View Slide

  3. The infamous V3

    View Slide

  4. Front
    Admin
    API
    Workers
    Monolithic application

    View Slide

  5. It’s huge

    View Slide

  6. 406 187
    NLOC
    There are “only” 268 041 NLOC for symfony/symfony

    View Slide

  7. 29 582
    Commits
    There are “only” 15 506 commits for symfony/symfony
    There are “only” 10 228 commits for joyent/node
    There are “only” 9 266 commits for twbs/bootstrap
    There are 44 809 commits for rails/rails (but it’s ruby… #troll)

    View Slide

  8. ~ 75
    contributors
    There are 1 193 contributors for symfony/symfony

    View Slide

  9. ~ 30
    minutes to run all the unit tests

    View Slide

  10. What else ?
    ● Long learning curve
    ● Too many side effects
    ● Time consuming
    ● Big maintenance
    ● Spaghetti code

    View Slide

  11. Now & the future

    View Slide

  12. countries
    NEW IN
    2015
    India
    Mexico
    Hungary
    Romania
    Serbia
    Croatia
    19

    View Slide

  13. Exponential growth
    20 million
    members in April 2015

    View Slide

  14. BlaBlaCar is deploying
    multiple datacenters

    View Slide

  15. We need to localize our data

    View Slide

  16. MICRO-SERVICES

    View Slide

  17. Micro-services
    Users, ratings, notifications, ridemap...

    View Slide

  18. Overview

    View Slide

  19. Overview

    View Slide

  20. NO API!

    View Slide

  21. The gateway

    View Slide

  22. ● It’s code.
    ● It uses DDD.
    ● Everyone love it!
    ● It’s very well organized.
    ● There’s a lot of (very) strict rules.
    ● It separates business logic & data access.
    ● It’s a vendor! It’s easy to use everywhere!

    View Slide

  23. How to: Get a rating

    View Slide

  24. Business

    View Slide

  25. View Slide

  26. Request

    View Slide

  27. Usage

    View Slide

  28. Usage

    View Slide

  29. Usage

    View Slide

  30. Handler

    View Slide

  31. Data

    View Slide

  32. ● Cache ready
    ● backend agnostic

    View Slide

  33. ● Cache ready
    ● Backend agnostic
    Encapsulation !

    View Slide

  34. D
    BALStorage

    View Slide

  35. RedisStorage

    View Slide

  36. Gateway
    ● Flexible
    ● Very strict
    ● Easy to test
    ● Deployed when needed
    ● Used for all new projects

    View Slide

  37. V3
    Previous ecosystem

    View Slide

  38. Gateway
    V3
    W
    W
    W
    W
    W
    C W
    C
    C
    C
    W
    Current ecosystem
    W
    ● 90 workers
    ● 40 commands

    View Slide

  39. V3
    W
    W
    W
    W
    W
    C
    W
    C
    C
    C
    W
    Future ecosystem?
    W
    Gateway
    Gateway
    Gateway

    View Slide

  40. V3
    W
    W
    W
    W
    W
    C
    W
    C
    C
    C
    W
    Future ecosystem?
    W
    B
    B
    B B
    B
    B
    D
    D
    D

    View Slide

  41. Micro services are not a silver bullet, they won’t
    solve all your problems.
    We are still working on our gateway stuff :)

    View Slide

  42. Thank you
    Bisous
    Buziaczki

    View Slide