SlideShare a Scribd company logo
A SOA Approximation using Symfony
Joseluis Laso & Carlos Agudo
Who we are
•Carlos Agudo (@karloslupus)
•Joseluis Laso (@jl_laso)
And Others.. (Spanish team)
• Petar Georgiev (@pgkirilov)
• Daniel Abad (@ruudy_es)
• Noel García (@wolfwolker)
• Joaquín Fernández Campo
(@xocas__)
• Miguel Vilata
(@miguelvilata)
Where?
What is Digilant
DSP: Demand Side Platform => programmatic
advertising.
We have a backend to configure ours RTB bidder(s)
architecture.
• A programmatic campaign can have thousands of
parameters.
Long journey
From monolithic sf1 (legacy , 8 years of development)
to a SOA in sf2-3:
Requirements
• API Rest
• Auto Scalable (can be a huge huge demanding
platform)
• Symfony 2
• Easy to deploy
So?
Do not try this at home
Yes Symfony 2-3
Bundle: “A bundle is simply a structured set of files within a
directory that implement a single feature. “
-- We can split services as bundles, and start here.
This sounds weird??
Uncle Bob: “Don't leap into microservices just because it
sounds cool. Segregate the system into jars using a plugin
architecture first. If that's not sufficient, then consider
introducing service boundaries at strategic points.”
Some Questions arose
• One repo? One per service orchestrated with composer?
• One repo, let’s split it later, and coordinate with composer
later. (easier to develop)
• One Db per service? One db for the whole project, with
soft-relations between services?
• One Db for the whole project, let’s split it later. (easier to
develop??, careful with soft-relations, lost of referential
integrity)
Our motto
Let’s split it later
And let’s start!!
Backend Services View
Bundles
Yes, services bundles
Service- Machine
We can create as many services-machine as we want.
Depending on demand. We can cook them!!
Fully elastic scalability.
LineItem Service - Machine
LineItem Core
LineItem- Campaign - Machine
LineItem
Campaign
Core
Cooking Process 1
Using ansistrano (ansible), in each deploy, we can
select how many bundles a machine have.
Machine A- Geo and Creatives Machine B- All services but Pixel
Cooking Process 2
We need to dynamically load, our “bundles-service” on
deploy, our models, our routings, etc..
A lot of magic happens here!
Compiler pass to the rescue!
Cooking Process 3
In our AppKernel.php. We have the LocateBundles (utility
class) in a CoreBundle
Core Bundle
We have a CoreBundle, that act as a glue, (Compiler
passes)
• Communication between services (Can be http-
external, http-internal, process) We have a call
Router. API-REST, that’s why http-internal or external
• Some bussines event listeners (a filter for accounts,
softdelete, audit db listener)
• User-Permission Model
Models 1
In order to don’t get coupled to the persistence
implementation (Doctrine), don’t use annotations for
defining the model, map in an xml:
Models 2
We want to use our own folders:
Base?? We will explain it later, we have an
autogenerator of code.
Models 3
Compiler Pass to Load Models in our own folders.
We pass through our bundles, and
load models, in our folders.
The key:
DoctrineOrmMappingPass
We also use an alias:
LineItem:ThirdPartyData
Geo:City
ServiceName:Model
Others Compilers Passes
Here we load our services
(symfony) in each Bundle.
Also Lists calls (api-rest list
call, defaults limit per
model, orderby etc..)
Others Compilers Passes II
Load the routes per each bundle!
Controller Services
GeoBundle/Resources/config/services.yml
imports:
- resource: ServicesControllers/alpha.yml
We load versionable controllers (alpha, v1..) as services:
Right now: alpha (Remember WIP?)
Routes:
/alpha/creative/*
/current/creative/*
A lot of CRUD tables-controllers
We have a lot of master-
admin tables.
We have a RestController
for this purpose.
Controversy:
- We have a lot of
classes child of this
one.
- Needs refactor in
services!
2nd part
And now ….
The funny part :)
Generator of code
Once upon a time …
We had time and we were youngs :) and we decide to
invest time creating a code generator to make our life
easier … you know ? developers ... this lazy race
With a lot of database schemas per create we thought
that was a good idea to convert this MWB files
directly in code … and was a really nightmare ...
Code generator (AKA mwb-import)
But … it worked
MWB file
it’s a ZIP
xml
sqlite
etc ..
unzip
generate
code with twig
generate
fixtures
Code generator (AKA mwb-import)
ApiDoc documentation generator
document !
document !
document !
document !
document !
document !
ApiDoc documentation generator
But not only generates documentation.
Why don’t use annotations to generate automatic
documentation of API routes ?
There are a couple of bundles in the market that do
this.
Again … we thought that we can do better.
ApiDoc documentation generator
/**
* @ApiDocDescription("Create an Account")
* @ApiDocMethod("post")
* @ApiDocRoute("/account")
* @ApiDocVersion("~")
* @ApiDocSubdomain("account")
* @ApiDocParam(name="maxBudgetValue",type="decimal",nullable=false,description="Account
maxBudgetValue")
* @ApiDocHeader(name="Authorization", placeholder="Authorization: Bearer {token}", type="string",
nullable=false, description="mandatory token obtained in login check call")
* @ApiDocReturnHeader("
* HTTP 200 OK
* Cache-Control: no-cache
* Content-Type: application/json
* ")
* @ApiDocReturnData(type="json", sample="{'id':'integer'}")
*/
public function createAction(Request $request)
Documentator
Features:
automatic creation of documentation in html format,
including a sandbox to test API endpoints
Documentator
Documentator
Features:
automatic creation of documentation in html format,
including a sandbox to test API endpoints
- export to
POSTMAN
collection
Call Router
How to make a call to a service that you even know
where is ?
LineItem Service - Machine
LineItem Core
LineItem- Campaign - Machine
LineItem
Campaign
Core
Call Router
How to call a controller method if you don’t know
where exactly is ?
Remember, we can deploy to n-servers …
To solve that we created a CallRouter that makes the
call internally (if the server has the service required)
or makes the call external (guzzle) if the service is in
another server.
Call Router
try {
// ...
$route = $this->router->match($pathInfo);
return $this->makeInternalCall($route['_controller'], $request);
} catch (ResourceNotFoundException $e) {
return $this->makeExternalCall($request->getMethod(), $subdomain,
$pathInfo, $request->getContent());
}
A SOA approximation on symfony
A SOA approximation on symfony

More Related Content

What's hot

Ambry : Linkedin's Scalable Geo-Distributed Object Store
Ambry : Linkedin's Scalable Geo-Distributed Object StoreAmbry : Linkedin's Scalable Geo-Distributed Object Store
Ambry : Linkedin's Scalable Geo-Distributed Object Store
Sivabalan Narayanan
 
Mini Training Flyway
Mini Training FlywayMini Training Flyway
Mini Training Flyway
Betclic Everest Group Tech Team
 
Interop 2015: Hardly Enough Theory, Barley Enough Code
Interop 2015: Hardly Enough Theory, Barley Enough CodeInterop 2015: Hardly Enough Theory, Barley Enough Code
Interop 2015: Hardly Enough Theory, Barley Enough Code
Jeremy Schulman
 
Training on iOS app development - Samesh Swongamikha & Neetin Sharma
Training on iOS app development - Samesh Swongamikha & Neetin SharmaTraining on iOS app development - Samesh Swongamikha & Neetin Sharma
Training on iOS app development - Samesh Swongamikha & Neetin Sharma
MobileNepal
 
Performance and Abstractions
Performance and AbstractionsPerformance and Abstractions
Performance and Abstractions
Metosin Oy
 
Database migrations with Flyway and Liquibase
Database migrations with Flyway and LiquibaseDatabase migrations with Flyway and Liquibase
Database migrations with Flyway and Liquibase
Lars Östling
 
Asynchronous programming in ASP.NET
Asynchronous programming in ASP.NETAsynchronous programming in ASP.NET
Asynchronous programming in ASP.NET
Alex Thissen
 
ReactPHP + Symfony
ReactPHP + SymfonyReactPHP + Symfony
ReactPHP + Symfony
David Bergunder
 
Entity Framework Core 1.0
Entity Framework Core 1.0Entity Framework Core 1.0
Entity Framework Core 1.0
Senthil Kumar
 
Take a Look at Akka+Java (English version)
Take a Look at Akka+Java (English version)Take a Look at Akka+Java (English version)
Take a Look at Akka+Java (English version)
GlobalLogic Ukraine
 
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Dylan Butler
 
Discover the Capabilities of Windows Azure Service Bus to Power Agile Busines...
Discover the Capabilities of Windows Azure Service Bus to Power Agile Busines...Discover the Capabilities of Windows Azure Service Bus to Power Agile Busines...
Discover the Capabilities of Windows Azure Service Bus to Power Agile Busines...
Sergio Compean
 
JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platforms
Payara
 
The future of cloud programming
The future of cloud programmingThe future of cloud programming
The future of cloud programming
Jason Straughan
 
Entity Framework 7: What's New?
Entity Framework 7: What's New?Entity Framework 7: What's New?
Entity Framework 7: What's New?
Ricardo Peres
 
Flyway: The agile database migration framework for Java
Flyway: The agile database migration framework for JavaFlyway: The agile database migration framework for Java
Flyway: The agile database migration framework for Java
Axel Fontaine
 
4. introduction to Asp.Net MVC - Part II
4. introduction to Asp.Net MVC - Part II4. introduction to Asp.Net MVC - Part II
4. introduction to Asp.Net MVC - Part II
Rohit Rao
 
Client server
Client serverClient server
Client server
Mike Feltman
 
Effective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfileEffective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfile
Payara
 
Node.js at Nutonian
Node.js at NutonianNode.js at Nutonian
Node.js at Nutonian
Lakshmikant Shrinivas
 

What's hot (20)

Ambry : Linkedin's Scalable Geo-Distributed Object Store
Ambry : Linkedin's Scalable Geo-Distributed Object StoreAmbry : Linkedin's Scalable Geo-Distributed Object Store
Ambry : Linkedin's Scalable Geo-Distributed Object Store
 
Mini Training Flyway
Mini Training FlywayMini Training Flyway
Mini Training Flyway
 
Interop 2015: Hardly Enough Theory, Barley Enough Code
Interop 2015: Hardly Enough Theory, Barley Enough CodeInterop 2015: Hardly Enough Theory, Barley Enough Code
Interop 2015: Hardly Enough Theory, Barley Enough Code
 
Training on iOS app development - Samesh Swongamikha & Neetin Sharma
Training on iOS app development - Samesh Swongamikha & Neetin SharmaTraining on iOS app development - Samesh Swongamikha & Neetin Sharma
Training on iOS app development - Samesh Swongamikha & Neetin Sharma
 
Performance and Abstractions
Performance and AbstractionsPerformance and Abstractions
Performance and Abstractions
 
Database migrations with Flyway and Liquibase
Database migrations with Flyway and LiquibaseDatabase migrations with Flyway and Liquibase
Database migrations with Flyway and Liquibase
 
Asynchronous programming in ASP.NET
Asynchronous programming in ASP.NETAsynchronous programming in ASP.NET
Asynchronous programming in ASP.NET
 
ReactPHP + Symfony
ReactPHP + SymfonyReactPHP + Symfony
ReactPHP + Symfony
 
Entity Framework Core 1.0
Entity Framework Core 1.0Entity Framework Core 1.0
Entity Framework Core 1.0
 
Take a Look at Akka+Java (English version)
Take a Look at Akka+Java (English version)Take a Look at Akka+Java (English version)
Take a Look at Akka+Java (English version)
 
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
 
Discover the Capabilities of Windows Azure Service Bus to Power Agile Busines...
Discover the Capabilities of Windows Azure Service Bus to Power Agile Busines...Discover the Capabilities of Windows Azure Service Bus to Power Agile Busines...
Discover the Capabilities of Windows Azure Service Bus to Power Agile Busines...
 
JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platforms
 
The future of cloud programming
The future of cloud programmingThe future of cloud programming
The future of cloud programming
 
Entity Framework 7: What's New?
Entity Framework 7: What's New?Entity Framework 7: What's New?
Entity Framework 7: What's New?
 
Flyway: The agile database migration framework for Java
Flyway: The agile database migration framework for JavaFlyway: The agile database migration framework for Java
Flyway: The agile database migration framework for Java
 
4. introduction to Asp.Net MVC - Part II
4. introduction to Asp.Net MVC - Part II4. introduction to Asp.Net MVC - Part II
4. introduction to Asp.Net MVC - Part II
 
Client server
Client serverClient server
Client server
 
Effective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfileEffective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfile
 
Node.js at Nutonian
Node.js at NutonianNode.js at Nutonian
Node.js at Nutonian
 

Viewers also liked

PHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the foolPHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the fool
Alessandro Cinelli (cirpo)
 
Telephony with OpenShift Twilio and MongoDB
Telephony with OpenShift Twilio and MongoDBTelephony with OpenShift Twilio and MongoDB
Telephony with OpenShift Twilio and MongoDB
Mark Atwood
 
Go from PHP engineer's perspective
Go from PHP engineer's perspectiveGo from PHP engineer's perspective
Go from PHP engineer's perspective
Sobit Akhmedov
 
Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2
Stefano Valle
 
Zend Framework 2 - Basic Components
Zend Framework 2  - Basic ComponentsZend Framework 2  - Basic Components
Zend Framework 2 - Basic Components
Mateusz Tymek
 
Zend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency InjectionZend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency Injection
Abdul Malik Ikhsan
 
A soa approximation on symfony
A soa approximation on symfonyA soa approximation on symfony
A soa approximation on symfony
Carlos Agudo Belloso
 
Scalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on RailsScalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on Rails
Jared Rosoff
 
Symfony in microservice architecture
Symfony in microservice architectureSymfony in microservice architecture
Symfony in microservice architecture
Daniele D'Angeli
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Igor Anishchenko
 
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)
Ivo Jansch
 

Viewers also liked (11)

PHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the foolPHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the fool
 
Telephony with OpenShift Twilio and MongoDB
Telephony with OpenShift Twilio and MongoDBTelephony with OpenShift Twilio and MongoDB
Telephony with OpenShift Twilio and MongoDB
 
Go from PHP engineer's perspective
Go from PHP engineer's perspectiveGo from PHP engineer's perspective
Go from PHP engineer's perspective
 
Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2
 
Zend Framework 2 - Basic Components
Zend Framework 2  - Basic ComponentsZend Framework 2  - Basic Components
Zend Framework 2 - Basic Components
 
Zend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency InjectionZend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency Injection
 
A soa approximation on symfony
A soa approximation on symfonyA soa approximation on symfony
A soa approximation on symfony
 
Scalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on RailsScalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on Rails
 
Symfony in microservice architecture
Symfony in microservice architectureSymfony in microservice architecture
Symfony in microservice architecture
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased Comparison
 
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)
 

Similar to A SOA approximation on symfony

VisualWeb - Building a NodeJS Server Meshwork and Full-Javascript Stack Frame...
VisualWeb - Building a NodeJS Server Meshwork and Full-Javascript Stack Frame...VisualWeb - Building a NodeJS Server Meshwork and Full-Javascript Stack Frame...
VisualWeb - Building a NodeJS Server Meshwork and Full-Javascript Stack Frame...
itsatony
 
Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)
DoiT International
 
Enterprise Integration Patterns and Apache Camel
Enterprise Integration Patterns and Apache CamelEnterprise Integration Patterns and Apache Camel
Enterprise Integration Patterns and Apache Camel
Miloš Zubal
 
Build your own discovery index of scholary e-resources
Build your own discovery index of scholary e-resourcesBuild your own discovery index of scholary e-resources
Build your own discovery index of scholary e-resources
Martin Czygan
 
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
Alexandre Brandão Lustosa
 
Building a scalable API with Grails
Building a scalable API with GrailsBuilding a scalable API with Grails
Building a scalable API with Grails
Tanausu Cerdeña
 
Toward Hybrid Cloud Serverless Transparency with Lithops Framework
Toward Hybrid Cloud Serverless Transparency with Lithops FrameworkToward Hybrid Cloud Serverless Transparency with Lithops Framework
Toward Hybrid Cloud Serverless Transparency with Lithops Framework
LibbySchulze
 
EclipseCon 2016 - OCCIware : one Cloud API to rule them all
EclipseCon 2016 - OCCIware : one Cloud API to rule them allEclipseCon 2016 - OCCIware : one Cloud API to rule them all
EclipseCon 2016 - OCCIware : one Cloud API to rule them all
Marc Dutoo
 
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open WideOCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware
 
Has serverless adoption hit a roadblock?
Has serverless adoption hit a roadblock?Has serverless adoption hit a roadblock?
Has serverless adoption hit a roadblock?
Veselin Pizurica
 
Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!
Animesh Singh
 
Apache Kafka® Delivers a Single Source of Truth for The New York Times
Apache Kafka® Delivers a Single Source of Truth for The New York TimesApache Kafka® Delivers a Single Source of Truth for The New York Times
Apache Kafka® Delivers a Single Source of Truth for The New York Times
confluent
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
Michael Vorburger
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in Golang
Mo'ath Qasim
 
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and PrometheusRobust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
Manasi Vartak
 
Writing Rust Command Line Applications
Writing Rust Command Line ApplicationsWriting Rust Command Line Applications
Writing Rust Command Line Applications
All Things Open
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titanium
Naga Harish M
 
APIdays Barcelona 2019 - How to build a social network on Serverless with Yan...
APIdays Barcelona 2019 - How to build a social network on Serverless with Yan...APIdays Barcelona 2019 - How to build a social network on Serverless with Yan...
APIdays Barcelona 2019 - How to build a social network on Serverless with Yan...
apidays
 
How to build a social network on serverless
How to build a social network on serverlessHow to build a social network on serverless
How to build a social network on serverless
Yan Cui
 
Kubecon seattle 2018 recap - Application Deployment aspects
Kubecon seattle 2018 recap - Application Deployment aspectsKubecon seattle 2018 recap - Application Deployment aspects
Kubecon seattle 2018 recap - Application Deployment aspects
Krishna-Kumar
 

Similar to A SOA approximation on symfony (20)

VisualWeb - Building a NodeJS Server Meshwork and Full-Javascript Stack Frame...
VisualWeb - Building a NodeJS Server Meshwork and Full-Javascript Stack Frame...VisualWeb - Building a NodeJS Server Meshwork and Full-Javascript Stack Frame...
VisualWeb - Building a NodeJS Server Meshwork and Full-Javascript Stack Frame...
 
Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)
 
Enterprise Integration Patterns and Apache Camel
Enterprise Integration Patterns and Apache CamelEnterprise Integration Patterns and Apache Camel
Enterprise Integration Patterns and Apache Camel
 
Build your own discovery index of scholary e-resources
Build your own discovery index of scholary e-resourcesBuild your own discovery index of scholary e-resources
Build your own discovery index of scholary e-resources
 
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
 
Building a scalable API with Grails
Building a scalable API with GrailsBuilding a scalable API with Grails
Building a scalable API with Grails
 
Toward Hybrid Cloud Serverless Transparency with Lithops Framework
Toward Hybrid Cloud Serverless Transparency with Lithops FrameworkToward Hybrid Cloud Serverless Transparency with Lithops Framework
Toward Hybrid Cloud Serverless Transparency with Lithops Framework
 
EclipseCon 2016 - OCCIware : one Cloud API to rule them all
EclipseCon 2016 - OCCIware : one Cloud API to rule them allEclipseCon 2016 - OCCIware : one Cloud API to rule them all
EclipseCon 2016 - OCCIware : one Cloud API to rule them all
 
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open WideOCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
 
Has serverless adoption hit a roadblock?
Has serverless adoption hit a roadblock?Has serverless adoption hit a roadblock?
Has serverless adoption hit a roadblock?
 
Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!
 
Apache Kafka® Delivers a Single Source of Truth for The New York Times
Apache Kafka® Delivers a Single Source of Truth for The New York TimesApache Kafka® Delivers a Single Source of Truth for The New York Times
Apache Kafka® Delivers a Single Source of Truth for The New York Times
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in Golang
 
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and PrometheusRobust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
 
Writing Rust Command Line Applications
Writing Rust Command Line ApplicationsWriting Rust Command Line Applications
Writing Rust Command Line Applications
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titanium
 
APIdays Barcelona 2019 - How to build a social network on Serverless with Yan...
APIdays Barcelona 2019 - How to build a social network on Serverless with Yan...APIdays Barcelona 2019 - How to build a social network on Serverless with Yan...
APIdays Barcelona 2019 - How to build a social network on Serverless with Yan...
 
How to build a social network on serverless
How to build a social network on serverlessHow to build a social network on serverless
How to build a social network on serverless
 
Kubecon seattle 2018 recap - Application Deployment aspects
Kubecon seattle 2018 recap - Application Deployment aspectsKubecon seattle 2018 recap - Application Deployment aspects
Kubecon seattle 2018 recap - Application Deployment aspects
 

Recently uploaded

学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
ijaia
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
Prakhyath Rai
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
AI for Legal Research with applications, tools
AI for Legal Research with applications, toolsAI for Legal Research with applications, tools
AI for Legal Research with applications, tools
mahaffeycheryld
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
PIMR BHOPAL
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
bijceesjournal
 

Recently uploaded (20)

学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
AI for Legal Research with applications, tools
AI for Legal Research with applications, toolsAI for Legal Research with applications, tools
AI for Legal Research with applications, tools
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
 

A SOA approximation on symfony

  • 1. A SOA Approximation using Symfony Joseluis Laso & Carlos Agudo
  • 2. Who we are •Carlos Agudo (@karloslupus) •Joseluis Laso (@jl_laso) And Others.. (Spanish team) • Petar Georgiev (@pgkirilov) • Daniel Abad (@ruudy_es) • Noel García (@wolfwolker) • Joaquín Fernández Campo (@xocas__) • Miguel Vilata (@miguelvilata)
  • 4. What is Digilant DSP: Demand Side Platform => programmatic advertising. We have a backend to configure ours RTB bidder(s) architecture. • A programmatic campaign can have thousands of parameters.
  • 5. Long journey From monolithic sf1 (legacy , 8 years of development) to a SOA in sf2-3:
  • 6. Requirements • API Rest • Auto Scalable (can be a huge huge demanding platform) • Symfony 2 • Easy to deploy
  • 7. So?
  • 8. Do not try this at home
  • 9. Yes Symfony 2-3 Bundle: “A bundle is simply a structured set of files within a directory that implement a single feature. “ -- We can split services as bundles, and start here. This sounds weird?? Uncle Bob: “Don't leap into microservices just because it sounds cool. Segregate the system into jars using a plugin architecture first. If that's not sufficient, then consider introducing service boundaries at strategic points.”
  • 10. Some Questions arose • One repo? One per service orchestrated with composer? • One repo, let’s split it later, and coordinate with composer later. (easier to develop) • One Db per service? One db for the whole project, with soft-relations between services? • One Db for the whole project, let’s split it later. (easier to develop??, careful with soft-relations, lost of referential integrity)
  • 11. Our motto Let’s split it later And let’s start!!
  • 14. Service- Machine We can create as many services-machine as we want. Depending on demand. We can cook them!! Fully elastic scalability. LineItem Service - Machine LineItem Core LineItem- Campaign - Machine LineItem Campaign Core
  • 15. Cooking Process 1 Using ansistrano (ansible), in each deploy, we can select how many bundles a machine have. Machine A- Geo and Creatives Machine B- All services but Pixel
  • 16. Cooking Process 2 We need to dynamically load, our “bundles-service” on deploy, our models, our routings, etc.. A lot of magic happens here! Compiler pass to the rescue!
  • 17. Cooking Process 3 In our AppKernel.php. We have the LocateBundles (utility class) in a CoreBundle
  • 18. Core Bundle We have a CoreBundle, that act as a glue, (Compiler passes) • Communication between services (Can be http- external, http-internal, process) We have a call Router. API-REST, that’s why http-internal or external • Some bussines event listeners (a filter for accounts, softdelete, audit db listener) • User-Permission Model
  • 19. Models 1 In order to don’t get coupled to the persistence implementation (Doctrine), don’t use annotations for defining the model, map in an xml:
  • 20. Models 2 We want to use our own folders: Base?? We will explain it later, we have an autogenerator of code.
  • 21. Models 3 Compiler Pass to Load Models in our own folders. We pass through our bundles, and load models, in our folders. The key: DoctrineOrmMappingPass We also use an alias: LineItem:ThirdPartyData Geo:City ServiceName:Model
  • 22. Others Compilers Passes Here we load our services (symfony) in each Bundle. Also Lists calls (api-rest list call, defaults limit per model, orderby etc..)
  • 23. Others Compilers Passes II Load the routes per each bundle!
  • 24. Controller Services GeoBundle/Resources/config/services.yml imports: - resource: ServicesControllers/alpha.yml We load versionable controllers (alpha, v1..) as services: Right now: alpha (Remember WIP?) Routes: /alpha/creative/* /current/creative/*
  • 25. A lot of CRUD tables-controllers We have a lot of master- admin tables. We have a RestController for this purpose. Controversy: - We have a lot of classes child of this one. - Needs refactor in services!
  • 26. 2nd part And now …. The funny part :)
  • 27. Generator of code Once upon a time … We had time and we were youngs :) and we decide to invest time creating a code generator to make our life easier … you know ? developers ... this lazy race With a lot of database schemas per create we thought that was a good idea to convert this MWB files directly in code … and was a really nightmare ...
  • 28. Code generator (AKA mwb-import) But … it worked MWB file it’s a ZIP xml sqlite etc .. unzip generate code with twig generate fixtures
  • 29. Code generator (AKA mwb-import)
  • 30. ApiDoc documentation generator document ! document ! document ! document ! document ! document !
  • 31. ApiDoc documentation generator But not only generates documentation. Why don’t use annotations to generate automatic documentation of API routes ? There are a couple of bundles in the market that do this. Again … we thought that we can do better.
  • 32. ApiDoc documentation generator /** * @ApiDocDescription("Create an Account") * @ApiDocMethod("post") * @ApiDocRoute("/account") * @ApiDocVersion("~") * @ApiDocSubdomain("account") * @ApiDocParam(name="maxBudgetValue",type="decimal",nullable=false,description="Account maxBudgetValue") * @ApiDocHeader(name="Authorization", placeholder="Authorization: Bearer {token}", type="string", nullable=false, description="mandatory token obtained in login check call") * @ApiDocReturnHeader(" * HTTP 200 OK * Cache-Control: no-cache * Content-Type: application/json * ") * @ApiDocReturnData(type="json", sample="{'id':'integer'}") */ public function createAction(Request $request)
  • 33. Documentator Features: automatic creation of documentation in html format, including a sandbox to test API endpoints
  • 35. Documentator Features: automatic creation of documentation in html format, including a sandbox to test API endpoints - export to POSTMAN collection
  • 36. Call Router How to make a call to a service that you even know where is ? LineItem Service - Machine LineItem Core LineItem- Campaign - Machine LineItem Campaign Core
  • 37. Call Router How to call a controller method if you don’t know where exactly is ? Remember, we can deploy to n-servers … To solve that we created a CallRouter that makes the call internally (if the server has the service required) or makes the call external (guzzle) if the service is in another server.
  • 38. Call Router try { // ... $route = $this->router->match($pathInfo); return $this->makeInternalCall($route['_controller'], $request); } catch (ResourceNotFoundException $e) { return $this->makeExternalCall($request->getMethod(), $subdomain, $pathInfo, $request->getContent()); }