PHPCon 2015 - The technical story of BlaBlaCar

PHPCon 2015 - The technical story of BlaBlaCar

Talk given with @odolbeau at the 2015 PHPCon in Poland

0bd054e9a591ec3afb355f5c2c899a23?s=128

Benjamin De Bernardi

November 14, 2015
Tweet

Transcript

  1. None
  2. @odolbeau Web Architect Olivier Dolbeau

  3. @Genes0r Web Developer Benjamin De Bernardi

  4. Leader ride-sharing service. Our goal is to become the 1st

    travel platform. 30€ 30€ 30€ 30€
  5. v1.0 2005-2006

  6. The prototype

  7. Let the journey begins!

  8. V2 (2008)

  9. 2010 Start opening new countries. 2011 2012

  10. 1 million members.

  11. None
  12. Plain (old) PHP

  13. Homemade framework

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

    the longest one.
  15. NOT TESTED

  16. None
  17. None
  18. Huge community.

  19. Attract new people.

  20. None
  21. V3

  22. Lot of new tools.

  23. None
  24. None
  25. None
  26. elasticsearch • Scalable • aggregations • geo type index

  27. None
  28. Asynchronous jobs everywhere. • performance • separation of concern

  29. 129 workers. mail sms publication push indexation image resizing alerts

    profile completion We love workers!
  30. 30% HIT/MISS “Firemode” to handle high traffic Reverse proxy

  31. None
  32. None
  33. None
  34. None
  35. None
  36. In the meantime...

  37. 2012 2013 2014 2015 Still opening new countries.

  38. Under the hood

  39. Symfony Upgrades Started with SF2 2.0 Upgrade as soon as

    we can Remove deprecated code Follow best practices 2.0 → 2.7
  40. Configuration 1 conf file for each country 100+ configuration keys

    Fallback on default Inheritance for localized websites Toggling of features
  41. Configuration

  42. Configuration

  43. Dynamic Features On the fly changes Multiple environnements Wide range

    of filters API Open source (Github)
  44. Dynamic Features

  45. • Awesome new technos • Awesome v3 • Awesome new

    countries. Job done?
  46. 406 187 NLOC There are “only” 268 041 NLOC for

    symfony/symfony
  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)
  48. ~ 75 contributors There are 1 193 contributors for symfony/symfony

  49. ~ 30 minutes to run all the unit tests

  50. ~ 30 minutes to deploy the application

  51. What else ? • Long learning curve • Too many

    side effects • Time consuming • Big maintenance • Spaghetti code
  52. MICRO-SERVICES

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

  54. MICRO-SERVICES

  55. MICRO-SERVICES

  56. NO API!

  57. The gateway

  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
  59. How to: Get a rating

  60. Business

  61. A Web Service Like Conversation

  62. Data

  63. • Cache ready • Backend agnostic

  64. • Cache ready • Backend agnostic Encapsulation !

  65. DBALStorage is able to contain a RedisStorage Encapsulation !

  66. Gateway The gateway • Flexible • Easy to test •

    Deployed when needed • Used for all new projects
  67. V3 Previous ecosystem

  68. Gateway V3 W W W W W C W C

    C C W Current ecosystem W • 90 workers • 40 commands
  69. V3 W W W W W C W C C

    C W Future ecosystem? W Gateway Gateway Gateway
  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
  71. We moved from an homemade framework to a monolith. We

    want to move from this monolith to microservices.
  72. Keep growing! Simpler with several small applications?

  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