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
Ad

More Related Content

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
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
 
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
 
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
 
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
 
Effective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfileEffective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfile
Payara
 

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
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
 
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
 
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
 
Ad

Similar to A SOA approximation on symfony (20)

Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
anglekaan18
 
2025-03-20 - How to use AI to your advantage - AI-Driven Development.pdf
2025-03-20 - How to use AI to your advantage - AI-Driven Development.pdf2025-03-20 - How to use AI to your advantage - AI-Driven Development.pdf
2025-03-20 - How to use AI to your advantage - AI-Driven Development.pdf
Shereef
 
AOMEI Backupper Crack 2025 FREE Download
AOMEI Backupper Crack 2025 FREE DownloadAOMEI Backupper Crack 2025 FREE Download
AOMEI Backupper Crack 2025 FREE Download
muhammadwaqaryounus6
 
Wondershare PDFelement Pro Crack FREE Download
Wondershare PDFelement Pro Crack FREE DownloadWondershare PDFelement Pro Crack FREE Download
Wondershare PDFelement Pro Crack FREE Download
waqarcracker5
 
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
 
Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
anglekaan18
 
2025-03-20 - How to use AI to your advantage - AI-Driven Development.pdf
2025-03-20 - How to use AI to your advantage - AI-Driven Development.pdf2025-03-20 - How to use AI to your advantage - AI-Driven Development.pdf
2025-03-20 - How to use AI to your advantage - AI-Driven Development.pdf
Shereef
 
AOMEI Backupper Crack 2025 FREE Download
AOMEI Backupper Crack 2025 FREE DownloadAOMEI Backupper Crack 2025 FREE Download
AOMEI Backupper Crack 2025 FREE Download
muhammadwaqaryounus6
 
Wondershare PDFelement Pro Crack FREE Download
Wondershare PDFelement Pro Crack FREE DownloadWondershare PDFelement Pro Crack FREE Download
Wondershare PDFelement Pro Crack FREE Download
waqarcracker5
 
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
 
Ad

Recently uploaded (20)

π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
Explainable-Artificial-Intelligence-in-Disaster-Risk-Management (2).pptx_2024...
Explainable-Artificial-Intelligence-in-Disaster-Risk-Management (2).pptx_2024...Explainable-Artificial-Intelligence-in-Disaster-Risk-Management (2).pptx_2024...
Explainable-Artificial-Intelligence-in-Disaster-Risk-Management (2).pptx_2024...
LiyaShaji4
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
Kamal Acharya
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
aset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edgeaset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edge
alilamisse
 
Unit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatioUnit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatio
lakshitakumar291
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Basic Principles for Electronics Students
Basic Principles for Electronics StudentsBasic Principles for Electronics Students
Basic Principles for Electronics Students
cbdbizdev04
 
Engineering Chemistry First Year Fullerenes
Engineering Chemistry First Year FullerenesEngineering Chemistry First Year Fullerenes
Engineering Chemistry First Year Fullerenes
5g2jpd9sp4
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution ControlDust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Janapriya Roy
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
Explainable-Artificial-Intelligence-in-Disaster-Risk-Management (2).pptx_2024...
Explainable-Artificial-Intelligence-in-Disaster-Risk-Management (2).pptx_2024...Explainable-Artificial-Intelligence-in-Disaster-Risk-Management (2).pptx_2024...
Explainable-Artificial-Intelligence-in-Disaster-Risk-Management (2).pptx_2024...
LiyaShaji4
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
Kamal Acharya
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
aset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edgeaset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edge
alilamisse
 
Unit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatioUnit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatio
lakshitakumar291
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Basic Principles for Electronics Students
Basic Principles for Electronics StudentsBasic Principles for Electronics Students
Basic Principles for Electronics Students
cbdbizdev04
 
Engineering Chemistry First Year Fullerenes
Engineering Chemistry First Year FullerenesEngineering Chemistry First Year Fullerenes
Engineering Chemistry First Year Fullerenes
5g2jpd9sp4
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution ControlDust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Janapriya Roy
 

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()); }