Backend Mutation
With Symfony
Joris Calabrese
Head Of
Industrialization
Etienne Broutin
Architect
Meetic corp
• Started in 2001
• Leader in Europe, 17 countries
• Millions of Monthly Active Users
• 150 people in IT team
Past
•
Present
•
Future
Start up + Rapid Growth
=
Spaghetti
Monolithic code
Webservices
Backoffices
Mobile Web
WAP
Desktop
Cronjobs
…
700k
NLOC
Billing
Systems
DataBase centric architecture
Mailing
BI
Procedures
+ Triggers
Some Metrics
4 000
TABLES
900
configurations
400
Servers
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
Spaghetti + Quality Approach
=
J’ai de la chance
What Was Our Development Env?
• Locked Files System
• 1 Database for all Developers
• No Automated Tests
QA
• 1 release every 2 weeks
• 50 projects by release
• 1 button !
What Was Our
Quality Approach?
Who wants to play?
Illustration: mailchimp • mailchimp.com
When it works…
…and when it fails!
Some Stats
10
TEAMS
2
Deploy/WEEK
2012 2015
Plateform Growth
1
5
65
BUGS/WEEK
1
ROLLBACK/W
EEK
Spec v1
Bug Cost
Source: Applied Software Measurement, Capers Jones, 1996
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
New Talent + Innovation
Need
=
New Architecture
Target
All Clients are born equal in dignity and rights1
SOA architecture
Prevents code duplication
Mutualize features Web Services
But this single, centralized webservice will still be
huge and complex ?
Too long…
All Web Services have a single
responsibility
2
Message Photos Profile Search
Strict REST API
profiles messages
GET /profiles/xxxx
PUT /profiles/xxxx
GET /messages/xxxx
POST /messages
profiles messages
Do not share your data
Inside Business services
Symfony serialization for JSON input / output
Business Logic
Cache Layer
Doctrine DBAL
Controller
Service
Proxy Cache
DAO
Online Photos Profile Rights Search Boost
That means clients should make several calls to
display a single page?
Too long…
Online Photos Profile Rights Search Boost
But from client
point of view
Online Photos Profile Rights Search Boost
But from client
point of view
API Exposure Layer
Separation of concerns
business logic
database access
orchestration
security, sessions
configuration
UX
API Exposure Layer
Exposure layer
API Exposure Layer
Web Business Services
Back Office
Mailing
Payments
Inside Exposure Layer
Use Guzzle with batch calls
FOSRESTBundle
Orchestrate API calls
Assemble results from APIs
Controller
Manager
API Client
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
Migration
Strategy
Webservices
Web Business Services
New Quality Approach
Testing Strategy: Unit test
Threshold Spirit
Controller
Service
DAO
Complexity Code Coverage
Complexity Code Coverage
Complexity Code Coverage
Testing Strategy: Integration test
Continuous Integration
60
JOBS
5
Agents
5
Platform
10
builds in
prOgress
Product Centric
• Kept a good Knowledge
• Share Product Vision
• Share a same vocable
Behavior Driven Development
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
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
Docker Focus:
How to?
Docker
Compose
Exposure
Layer
Business
Service
Legacy
Service
Oracle
MySQL
1
2
3
4
5
23
45
QA Position
Design Build Test Prod
QA Position
Design Build Test Prod
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
Developer Community
• Continuous Learning
• Ease the sharing
• Improve the Skill Switching
• Community Of Practice
• BBL
Source Management
180
Repositories
12
groups
14
Technos
50+
Users
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.
Dev Infrastructure
API
API
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
Our New Future
• Impact management
• Reusability
From Architecture point of
view
Continuous Deployment
<< Dev Metrics
Prod Metrics >>
Next Challenges
Harder, Better,
Faster, Stronger!
by
Meetic Backend Mutation With Symfony

Meetic Backend Mutation With Symfony

Editor's Notes

  • #3 Alignement des noms
  • #4 Ajouter Meetic, Affinity Enlever amoureux.com
  • #7 Préciser les dates de création
  • #11 Sortir des Fiches pour les questions !
  • #12 I am lucky + curseur
  • #19 Faire attention,
  • #31 Masquer la photo ou prendre une photo spotlight (Je ne dois pas avoir le droit de l’exploiter ici)
  • #32 Masquer la photo ou prendre une photo spotlight (Je ne dois pas avoir le droit de l’exploiter ici)
  • #38 Coupe en deux l’espaces
  • #46 Alléger le slide en terme du contenu
  • #47 Code couleur
  • #52 Gitlab, car ca répondait au besoin.
  • #54 GITLAB Merge Request Open Sources & No quotas Visibility Community Management Skill Sharing Source Code / Documentation Manager JENKINS 8 Nodes: PHP (3), iOs (2), Java (1), WP (1), JS(1) 59 Jobs organized on 9 groups
  • #55 Sur les nouvelles briques
  • #60 - Facile, - Insister, - Mal à différencier le temps de la presentation, - Slide Developer Community -