Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Meetic Backend Mutation With Symfony

13,417 views

Published on

Comment Meetic opère son changement technologique sur son SI. De la création d’API jusqu’à la mise en place d’une démarche qualité tout en passant par l'adoption du Behavior Driven Development, vous saurez tout sur notre parcours, sur les problématiques que nous avons rencontrées, les solutions que nous avons mises en place ainsi que sur le chemin qu'il nous reste à parcourir afin d’appréhender l’avenir avec la plus grande des sérénités. Les thèmes abordés seront : - Comment aborder des changements majeurs sur notre SI sans impacter notre performance globale ? - Migration d'un code monolithique vers des API REST en Sf2, - Exemple de microservices : AB Test, GEO, Permission, Configuration. - Déploiement avec Composer, Satis, Sf2 et Capistrano sur des centaines de serveurs, - Démarche Qualité (Back, Front, App) : nos métriques, outils du marché, outils interne, gestion aux changements. - Méthodologie : Agilité, DevOps, TDD, BDD. - Next steps : Kafka, Continuous Delivery.

Published in: Technology

Meetic Backend Mutation With Symfony

  1. 1. Backend Mutation With Symfony
  2. 2. Joris Calabrese Head Of Industrialization Etienne Broutin Architect
  3. 3. Meetic corp • Started in 2001 • Leader in Europe, 17 countries • Millions of Monthly Active Users • 150 people in IT team
  4. 4. Past • Present • Future
  5. 5. Start up + Rapid Growth = Spaghetti
  6. 6. Monolithic code Webservices Backoffices Mobile Web WAP Desktop Cronjobs …
  7. 7. 700k NLOC
  8. 8. Billing Systems DataBase centric architecture Mailing BI Procedures + Triggers
  9. 9. Some Metrics 4 000 TABLES 900 configurations 400 Servers
  10. 10. Need to change something ? A. Ask 400 people B. Read all the code, understand everything then notify everyone C. Break everything D. Add a dirty “if” for your specific case D. Add a dirty “if” for your specific case
  11. 11. Spaghetti + Quality Approach = J’ai de la chance
  12. 12. What Was Our Development Env? • Locked Files System • 1 Database for all Developers • No Automated Tests
  13. 13. QA • 1 release every 2 weeks • 50 projects by release • 1 button ! What Was Our Quality Approach?
  14. 14. Who wants to play? Illustration: mailchimp • mailchimp.com
  15. 15. When it works…
  16. 16. …and when it fails!
  17. 17. Some Stats 10 TEAMS 2 Deploy/WEEK 2012 2015 Plateform Growth 1 5 65 BUGS/WEEK 1 ROLLBACK/W EEK Spec v1
  18. 18. Bug Cost Source: Applied Software Measurement, Capers Jones, 1996
  19. 19. And, If we want to add automated tests? A. Chuck Norris develops without bug B. Only test get_next_week() C. Mock 200 global variables and 35 functions D. I will do it when I have timeD. I will do it when I have time
  20. 20. New Talent + Innovation Need = New Architecture
  21. 21. Target
  22. 22. All Clients are born equal in dignity and rights1
  23. 23. SOA architecture Prevents code duplication Mutualize features Web Services
  24. 24. But this single, centralized webservice will still be huge and complex ? Too long…
  25. 25. All Web Services have a single responsibility 2 Message Photos Profile Search
  26. 26. Strict REST API profiles messages GET /profiles/xxxx PUT /profiles/xxxx GET /messages/xxxx POST /messages
  27. 27. profiles messages Do not share your data
  28. 28. Inside Business services Symfony serialization for JSON input / output Business Logic Cache Layer Doctrine DBAL Controller Service Proxy Cache DAO
  29. 29. Online Photos Profile Rights Search Boost That means clients should make several calls to display a single page? Too long…
  30. 30. Online Photos Profile Rights Search Boost But from client point of view
  31. 31. Online Photos Profile Rights Search Boost But from client point of view
  32. 32. API Exposure Layer
  33. 33. Separation of concerns business logic database access orchestration security, sessions configuration UX API Exposure Layer
  34. 34. Exposure layer API Exposure Layer Web Business Services Back Office Mailing Payments
  35. 35. Inside Exposure Layer Use Guzzle with batch calls FOSRESTBundle Orchestrate API calls Assemble results from APIs Controller Manager API Client
  36. 36. Android application Example to display a list of members GET /members Get a list of user ids using Location search Fetch user data Exposure Layer Configuration: group B uses location search AB Tests Search Profile user is from group B 1 2 3
  37. 37. Migration Strategy Webservices Web Business Services
  38. 38. New Quality Approach
  39. 39. Testing Strategy: Unit test
  40. 40. Threshold Spirit Controller Service DAO Complexity Code Coverage Complexity Code Coverage Complexity Code Coverage
  41. 41. Testing Strategy: Integration test
  42. 42. Continuous Integration 60 JOBS 5 Agents 5 Platform 10 builds in prOgress
  43. 43. Product Centric • Kept a good Knowledge • Share Product Vision • Share a same vocable Behavior Driven Development
  44. 44. Testing Strategy: Behavior Test Android application GET /members Exposure Layer AB Tests Search Profile 1 2 3 Given I am a user of the B group And my geoloc position is Paris When I launch a search on the online Then I see a list of profile And the first profiles are near of my position
  45. 45. Docker Focus • Allow the dev to automated testing all technical stack • 50 instances to launch in parallel • Different scope and context for the automated tests
  46. 46. Docker Focus: How to? Docker Compose Exposure Layer Business Service Legacy Service Oracle MySQL 1 2 3 4 5 23 45
  47. 47. QA Position Design Build Test Prod
  48. 48. QA Position Design Build Test Prod
  49. 49. Team Autopsy Front Developer • AngularJS, Grunt, … • Code Review • TDD, BDD Back Developer • Design • Symfony2, Composer, … • Code Review • TDD,BDD Product Owner • Define feature • Scenario writing • Define Business Indicators
  50. 50. Developer Community • Continuous Learning • Ease the sharing • Improve the Skill Switching • Community Of Practice • BBL
  51. 51. Source Management 180 Repositories 12 groups 14 Technos 50+ Users
  52. 52. Jenkins/Gitlab Focus master Working-branch Unit tests Integration tests Static Analyse Hey all! Who wants to review my MR? I would love to. You can assign it to me.
  53. 53. Dev Infrastructure API API
  54. 54. Some Stats 2012 2015 1x 7x Bug In By Week 2012 2015 2 10 Deployment by Day 0,5% Of rollback 3 756 Written tests 91,3 % Code coverage
  55. 55. Our New Future
  56. 56. • Impact management • Reusability From Architecture point of view
  57. 57. Continuous Deployment << Dev Metrics Prod Metrics >>
  58. 58. Next Challenges
  59. 59. Harder, Better, Faster, Stronger! by

×