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

From 1 to 20 millions users, the technical story of BlaBlaCar.

From 1 to 20 millions users, the technical story of BlaBlaCar.

Talk given with Benjamin De Bernardi aka Junior (@Genes0r) during PHPCon PL 2015

Olivier Dolbeau

November 14, 2015
Tweet

More Decks by Olivier Dolbeau

Other Decks in Programming

Transcript

  1. View Slide

  2. @odolbeau
    Web Architect
    Olivier Dolbeau

    View Slide

  3. @Genes0r
    Web Developer
    Benjamin De Bernardi

    View Slide

  4. Leader ride-sharing service.
    Our goal is to become the 1st travel platform.
    30€ 30€
    30€ 30€

    View Slide

  5. v1.0
    2005-2006

    View Slide

  6. The prototype

    View Slide

  7. Let the journey begins!

    View Slide

  8. V2 (2008)

    View Slide

  9. 2010
    Start opening new countries.
    2011 2012

    View Slide

  10. 1 million members.

    View Slide

  11. View Slide

  12. Plain (old) PHP

    View Slide

  13. Homemade
    framework

    View Slide

  14. lib.trip.php
    3770 lines of code
    69 functions
    926 lines for the longest one.

    View Slide

  15. NOT TESTED

    View Slide

  16. View Slide

  17. View Slide

  18. Huge community.

    View Slide

  19. Attract new people.

    View Slide

  20. View Slide

  21. V3

    View Slide

  22. Lot of new tools.

    View Slide

  23. View Slide

  24. View Slide

  25. View Slide

  26. elasticsearch
    ● Scalable
    ● aggregations
    ● geo type index

    View Slide

  27. View Slide

  28. Asynchronous jobs everywhere.
    ● performance
    ● separation of concern

    View Slide

  29. 129 workers.
    mail
    sms
    publication
    push
    indexation
    image
    resizing
    alerts
    profile
    completion
    We love
    workers!

    View Slide

  30. 30% HIT/MISS
    “Firemode” to handle
    high traffic
    Reverse proxy

    View Slide

  31. View Slide

  32. View Slide

  33. View Slide

  34. View Slide

  35. View Slide

  36. In the meantime...

    View Slide

  37. 2012 2013 2014 2015
    Still opening new countries.

    View Slide

  38. Under the hood

    View Slide

  39. Symfony Upgrades
    Started with SF2 2.0
    Upgrade as soon as we can
    Remove deprecated code
    Follow best practices
    2.0 → 2.7

    View Slide

  40. Configuration
    1 conf file for each country
    100+ configuration keys
    Fallback on default
    Inheritance for localized websites
    Toggling of features

    View Slide

  41. Configuration

    View Slide

  42. Configuration

    View Slide

  43. Dynamic Features
    On the fly changes
    Multiple environnements
    Wide range of filters
    API
    Open source (Github)

    View Slide

  44. Dynamic Features

    View Slide

  45. ● Awesome new technos
    ● Awesome v3
    ● Awesome new countries.
    Job done?

    View Slide

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

    View Slide

  47. 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

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

    View Slide

  49. ~ 30
    minutes to run all the unit tests

    View Slide

  50. ~ 30
    minutes to deploy the application

    View Slide

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

    View Slide

  52. MICRO-SERVICES

    View Slide

  53. Users, ratings, notifications, ridemap...
    MICRO-SERVICES

    View Slide

  54. MICRO-SERVICES

    View Slide

  55. MICRO-SERVICES

    View Slide

  56. NO API!

    View Slide

  57. The gateway

    View Slide

  58. The gateway
    ❖ 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 ! Easy to use everywhere

    View Slide

  59. How to: Get a rating

    View Slide

  60. Business

    View Slide

  61. A Web Service Like Conversation

    View Slide

  62. Data

    View Slide

  63. ● Cache ready
    ● Backend agnostic

    View Slide

  64. ● Cache ready
    ● Backend agnostic
    Encapsulation !

    View Slide

  65. DBALStorage is able to contain a
    RedisStorage
    Encapsulation !

    View Slide

  66. Gateway
    The gateway
    ● Flexible
    ● Easy to test
    ● Deployed when needed
    ● Used for all new projects

    View Slide

  67. V3
    Previous ecosystem

    View Slide

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

    View Slide

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

    View Slide

  70. 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

  71. We moved from an
    homemade framework
    to a monolith.
    We want to move from
    this monolith to
    microservices.

    View Slide

  72. Keep growing!
    Simpler with several small applications?

    View Slide

  73. ● Fail, learn, succeed!
    ● Microservices FTW!
    ● Be worldwide!
    Benjamin De
    Bernardi
    @Genes0r
    Olivier Dolbeau
    @odolbeau
    We’re hiring!
    In Paris & Warsaw!
    http://blbl.cr/dreamjobs

    View Slide