SlideShare a Scribd company logo
What we learned by merging
two big Symfony based
applications
Ivo Lukač @ PHPCE 2017, Poland
www.netgenlabs.com
• Ivo Lukač, co-founder of Netgen

Also: developer, site builder, architect, consultant, project manager,
evangelist, speaker, event organiser, business developer, …
• Netgen, web agency, Croatia, ~20 employees
• 15 years of experience building complex content-
centric web solutions, using eZ Publish since
2004, Symfony since 2013.
About me
www.netgenlabs.com
www.netgenlabs.com
Web Summer Camp
www.netgenlabs.com
HOW THIS STORY
STARTED
www.netgenlabs.com
• Clients are demanding better mixing of content and
commerce features
• Our stack:
• Content managed with eZ Publish / eZ Platform
• eCommerce features implemented with Sylius
CMS + eCommerce
www.netgenlabs.com
• eZ Publish CMS open-sourced in 1999 by eZ Systems
from Norway
• Complete refactoring started in 2011
• eZ Platform, the new generation based on Symfony,
released in 2015
• Flexible and customisable content model still the key
feature
www.netgenlabs.com
• Sylius - modern eCommerce based on Symfony2,
founded in 2011 by Paweł Jędrzejewski
• Modern coding standards, SOA, independent
components as bundles, IoC, BDD
• Version 1.0 stable released in 2017
www.netgenlabs.com
www.netgenlabs.com
INTEGRATION NEEDED
www.netgenlabs.com
Loose integration
• A usual approach for integrating 2 or more systems
is by establishing remote connections via
standard protocols (e.g. http)
• Remote systems are treated as black boxes and
completely independent
• Lastest buzzwords: “microservices” and “serverless”
www.netgenlabs.com
Symfony - common denominator
• Both eZ and Sylius use Symfony full stack as their
baseline, they have the same:



database access, template engine, service container,
logging, events, caching, security, mailing, assets,
environment configuration, translation, …
www.netgenlabs.com
Tight integration
• If 2 systems are built on the same framework and
use a lot of the same components - there is a
possibility to tightly integrate them on the same
application instance
• Suggesting new buzzword: “coupling decoupled”
www.netgenlabs.com
In 2015 we got a
suitable project.
Our partner Locastic
helped with Sylius
knowhow
First integration was
based on:

- eZ Publish 2014.11

- Sylius 0.14 

- Symfony 2.5
www.netgenlabs.com
www.netgenlabs.com
Repos
• github.com/netgen/ezpublish-community-sylius
Symfony application with merged Sylius and eZ
Publish
• github.com/netgen/NetgenEzSyliusBundle 

provides features that glue eZ and Sylius together
www.netgenlabs.com
In the meanwhile
• eZ Platform v1 was released, Sylius v1 was released, so
we are at the moment working on the new integration:
• ezplatform-sylius - new app repo
• ezpublish-community-sylius - deprecated
• NetgenEzSyliusBundle - master branch to be tagged as
version 2
www.netgenlabs.com
NetgenEzSyliusBundle - the glue
• Field type for linking Sylius products inside eZ Platform
content objects (translatable, sortable, removable)
• Replacing Sylius product routes with related eZ
Platform content routes
• User provider(s)
• Authentication success handler
www.netgenlabs.com
Working as expected?
• Twig template extend feature makes it easy to
integrate front side templates
• Database configuration can use the same
parameters
• Dependency injection and service container make it
trivial to use “the other system’s” features
www.netgenlabs.com
LETS TALK ABOUT
CHALLENGES
www.netgenlabs.com
1. Composing
2. Routing
3. Authentication
4. Authorization
5. Admin interface
Main challenges
www.netgenlabs.com
1. Composing
• Even if both systems are full stack Symfony it is possible to
run into problems during composing the app. Remember
we are talking about merging 2 big apps with many
dependencies
• Some dependencies could conflict (e.g. Doctrine)
• Fix choices:

- wait for the next release (create PRs to speed this up)

- some composer magic could help
www.netgenlabs.com
1. Composing
• It could happen that both systems support different Symfony
versions (Sylius 1.0 beta dropped support for Symfony 2
while eZ was still not working with Symfony 3)
• Fix choices:

- basically nothing, just waiting

- Sylius created a temporary BC branch:



"sylius/sylius":	"dev-revert-symfony3-updated	as	1.0"
www.netgenlabs.com
2. Routing
• If any of the systems doesn’t use the system router,
they should support the Chain router well (we had a
related bug in Sylius needed to be solved)
• One side should be prefixed:



sylius:

				resource:	"sylius_routing.yml"

				prefix:	%ez_sylius.shop_path_prefix%
www.netgenlabs.com
2. Routing
• As we were showing product with eZ URL, a custom
slug for Sylius product was implemented which used
eZ URL generator:



netgen_ez_sylius:

				routing:

								generate_url_aliases:	true
www.netgenlabs.com
3. Authentication
• Authenticating users separately should work
• Sylius 0.* used FOSUserBundle,
• Sylius 1.* uses custom user providers (plural !!!)
• eZ uses custom user provider
www.netgenlabs.com
3. SSO Authentication
• For SSO a security event listener is needed for
authenticating the user with both providers
• eZ Publish used the user class directly (not the
interface) so we couldn’t pass the Sylius user class:
we created a PR to be able to do this eventually
www.netgenlabs.com
4. Authorisation
• For authorisation to work a user object from one system
needs to be connected (treated as same) to the related
user object in another system
• If possible avoid the need for authorisation on both sides.
• For example, in our first project we need to connect the
admin users from both system but the site users didn’t
have to be authorised on eZ, only on Sylius
www.netgenlabs.com
4. Connecting related users
• To allow manual connecting of users we
implemented a script:



ezsylius:user:connect	<sylius-user-type>	
<sylius-user-email>	<ez-user-login>
• Of course, a post update/create user event support
would be a nicer solution
www.netgenlabs.com
4. Trouble with Sylius 1.*
• For Sylius 1.* lot of refactoring was done with lot of
BC brakes. One of the things was the user
management part: admin users and normal users
got completely separated.
• Our authentication and authorisation needed to be
done from scratch - we implemented a composite
user provider to handle all providers
www.netgenlabs.com
5. User interface
• If authentication and admin users authorisation is
working there is a chance to even merge the admin
interface
• In most cases probably not a straight forward to do
due to different UI frontend architectures. We needed
to do a PR to Sylius and also use bundle inheritance
www.netgenlabs.com
Pros
• With both systems working on the same instance the
possibility to mesh up things are much bigger
• Provides a single admin interface
• Problems could be spotted earlier, while in
development
www.netgenlabs.com
Cons
• Complexity, good expertise on both systems needed
• Depending on 2 roadmaps instead of 1
• Might be performance issues, at least when doing
composer update, due to lot of dependencies
www.netgenlabs.com
What we learned?
• A lot about Symfony and Composer :)
• To appreciate good roadmaps, semantic
versioning, extensible code
• Symfony does a lot of lifting, with Flex it might be
even more
www.netgenlabs.com
If you need something similar
• Have expertise on Symfony and both systems you
want to merge
• Check if both roadmaps and release cycles are
aligned
• Check if PRs are merged in reasonable time
• Check what licensing you need to apply
www.netgenlabs.com
Conclusion
• Tightly integrating 2 systems is probably an overkill
in lot of situations
• Could be worth the effort if you need:
• access to all underlaying features
• a single UI
• SSO and complex authorisation
Thank you!
ivo@netgen.hr
ilukac.com/twitter
ilukac.com/facebook
ilukac.com/linkedin

More Related Content

What's hot

Agile sites2
Agile sites2Agile sites2
Agile sites2
Michele Sciabarrà
 
Oleksandr Skachkov "Running С# in your Web Browser with WebAssembly"
Oleksandr Skachkov "Running С# in your Web Browser with WebAssembly"Oleksandr Skachkov "Running С# in your Web Browser with WebAssembly"
Oleksandr Skachkov "Running С# in your Web Browser with WebAssembly"
Fwdays
 
Basic web application development with Apache Cocoon 2.1
Basic web application development with  Apache Cocoon 2.1Basic web application development with  Apache Cocoon 2.1
Basic web application development with Apache Cocoon 2.1
Jeroen Reijn
 
Hire laravel-php-developers- Hire Laravel Programmers
Hire laravel-php-developers- Hire Laravel ProgrammersHire laravel-php-developers- Hire Laravel Programmers
Hire laravel-php-developers- Hire Laravel Programmers
Summation IT
 
Extending WordPress as a pro
Extending WordPress as a proExtending WordPress as a pro
Extending WordPress as a pro
Marko Heijnen
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPress
Danilo Ercoli
 
Using MAMP for Web Development
Using MAMP for Web DevelopmentUsing MAMP for Web Development
Using MAMP for Web Development
Eric Greene
 
Improve WordPress performance with caching and deferred execution of code
Improve WordPress performance with caching and deferred execution of codeImprove WordPress performance with caching and deferred execution of code
Improve WordPress performance with caching and deferred execution of code
Danilo Ercoli
 
Extensibility for ADF applications
Extensibility for ADF applicationsExtensibility for ADF applications
Extensibility for ADF applications
Denys Vuika
 
WordPress Development Tools and Best Practices
WordPress Development Tools and Best PracticesWordPress Development Tools and Best Practices
WordPress Development Tools and Best Practices
Danilo Ercoli
 
Ruby Setup
Ruby SetupRuby Setup
Ruby Setup
Alan Hecht
 
IBM Domino Modernizing apps with Angularjs
IBM Domino Modernizing apps with AngularjsIBM Domino Modernizing apps with Angularjs
IBM Domino Modernizing apps with Angularjs
Dominopoint - Italian Lotus User Group
 
Should you use HTML5 to build your product? The pros & cons of using current ...
Should you use HTML5 to build your product? The pros & cons of using current ...Should you use HTML5 to build your product? The pros & cons of using current ...
Should you use HTML5 to build your product? The pros & cons of using current ...
boxuno
 
One Neos CMS - many websites
One Neos CMS - many websitesOne Neos CMS - many websites
One Neos CMS - many websites
punkt.de GmbH
 
Testing Single Page Webapp
Testing Single Page WebappTesting Single Page Webapp
Testing Single Page Webapp
Akshay Mathur
 
ClubAJAX Basics - Server Communication
ClubAJAX Basics - Server CommunicationClubAJAX Basics - Server Communication
ClubAJAX Basics - Server Communication
Mike Wilcox
 
Isomorphic web application
Isomorphic web applicationIsomorphic web application
Isomorphic web application
Oliver N
 
Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1
asim78
 
docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...
Matteo Bisi
 

What's hot (20)

Agile sites2
Agile sites2Agile sites2
Agile sites2
 
Oleksandr Skachkov "Running С# in your Web Browser with WebAssembly"
Oleksandr Skachkov "Running С# in your Web Browser with WebAssembly"Oleksandr Skachkov "Running С# in your Web Browser with WebAssembly"
Oleksandr Skachkov "Running С# in your Web Browser with WebAssembly"
 
Basic web application development with Apache Cocoon 2.1
Basic web application development with  Apache Cocoon 2.1Basic web application development with  Apache Cocoon 2.1
Basic web application development with Apache Cocoon 2.1
 
Hire laravel-php-developers- Hire Laravel Programmers
Hire laravel-php-developers- Hire Laravel ProgrammersHire laravel-php-developers- Hire Laravel Programmers
Hire laravel-php-developers- Hire Laravel Programmers
 
Extending WordPress as a pro
Extending WordPress as a proExtending WordPress as a pro
Extending WordPress as a pro
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPress
 
Using MAMP for Web Development
Using MAMP for Web DevelopmentUsing MAMP for Web Development
Using MAMP for Web Development
 
Improve WordPress performance with caching and deferred execution of code
Improve WordPress performance with caching and deferred execution of codeImprove WordPress performance with caching and deferred execution of code
Improve WordPress performance with caching and deferred execution of code
 
Extensibility for ADF applications
Extensibility for ADF applicationsExtensibility for ADF applications
Extensibility for ADF applications
 
WordPress Development Tools and Best Practices
WordPress Development Tools and Best PracticesWordPress Development Tools and Best Practices
WordPress Development Tools and Best Practices
 
Ruby Setup
Ruby SetupRuby Setup
Ruby Setup
 
IBM Domino Modernizing apps with Angularjs
IBM Domino Modernizing apps with AngularjsIBM Domino Modernizing apps with Angularjs
IBM Domino Modernizing apps with Angularjs
 
Should you use HTML5 to build your product? The pros & cons of using current ...
Should you use HTML5 to build your product? The pros & cons of using current ...Should you use HTML5 to build your product? The pros & cons of using current ...
Should you use HTML5 to build your product? The pros & cons of using current ...
 
One Neos CMS - many websites
One Neos CMS - many websitesOne Neos CMS - many websites
One Neos CMS - many websites
 
Testing Single Page Webapp
Testing Single Page WebappTesting Single Page Webapp
Testing Single Page Webapp
 
ClubAJAX Basics - Server Communication
ClubAJAX Basics - Server CommunicationClubAJAX Basics - Server Communication
ClubAJAX Basics - Server Communication
 
Isomorphic web application
Isomorphic web applicationIsomorphic web application
Isomorphic web application
 
Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1
 
docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...
 

Similar to Merging two big Symfony based applications - PHPCE 2017

Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShift
Steven Pousty
 
OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012
Steven Pousty
 
The new way of managing layouts and blocks
The new way of managing layouts and blocksThe new way of managing layouts and blocks
The new way of managing layouts and blocks
Ivo Lukac
 
DSpace UI prototype dsember
DSpace UI prototype dsemberDSpace UI prototype dsember
DSpace UI prototype dsember
Bram Luyten
 
Joomla as a mobile App backend - ideas, examples and experiences
Joomla as a mobile App backend - ideas, examples and experiencesJoomla as a mobile App backend - ideas, examples and experiences
Joomla as a mobile App backend - ideas, examples and experiences
Andy_Gaskell
 
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
TIMETOACT GROUP
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
Betclic Everest Group Tech Team
 
Get acquainted with the new ASP.Net 5
Get acquainted with the new ASP.Net 5Get acquainted with the new ASP.Net 5
Get acquainted with the new ASP.Net 5
Suyati Technologies
 
Building APIs with Mule and Spring Boot
Building APIs with Mule and Spring BootBuilding APIs with Mule and Spring Boot
Building APIs with Mule and Spring Boot
Guilherme Pereira Silva
 
eSoftHead - groupware solution
eSoftHead - groupware solutioneSoftHead - groupware solution
eSoftHead - groupware solution
Nguyen Hai
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
Docker, Inc.
 
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...
Amazon Web Services
 
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and Joomla
George Wilson
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
Howard Greenberg
 
Amazon Web Services and PaaS - Enterprise Java for the Cloud Era? - Mark Pric...
Amazon Web Services and PaaS - Enterprise Java for the Cloud Era? - Mark Pric...Amazon Web Services and PaaS - Enterprise Java for the Cloud Era? - Mark Pric...
Amazon Web Services and PaaS - Enterprise Java for the Cloud Era? - Mark Pric...
jaxconf
 
DevOps demystified
DevOps demystifiedDevOps demystified
DevOps demystified
Xebia IT Architects
 
A Tale of Two Pizzas: Developer Tools at AWS - DevDay Los Angeles 2017
A Tale of Two Pizzas: Developer Tools at AWS - DevDay Los Angeles 2017A Tale of Two Pizzas: Developer Tools at AWS - DevDay Los Angeles 2017
A Tale of Two Pizzas: Developer Tools at AWS - DevDay Los Angeles 2017
Amazon Web Services
 
Mule ESB Intro
Mule ESB IntroMule ESB Intro
Mule ESB Intro
Noga Manela
 
XPages: No Experience Needed
XPages: No Experience NeededXPages: No Experience Needed
XPages: No Experience Needed
Kathy Brown
 
Picnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable applicationPicnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable application
Nick Josevski
 

Similar to Merging two big Symfony based applications - PHPCE 2017 (20)

Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShift
 
OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012
 
The new way of managing layouts and blocks
The new way of managing layouts and blocksThe new way of managing layouts and blocks
The new way of managing layouts and blocks
 
DSpace UI prototype dsember
DSpace UI prototype dsemberDSpace UI prototype dsember
DSpace UI prototype dsember
 
Joomla as a mobile App backend - ideas, examples and experiences
Joomla as a mobile App backend - ideas, examples and experiencesJoomla as a mobile App backend - ideas, examples and experiences
Joomla as a mobile App backend - ideas, examples and experiences
 
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
Get acquainted with the new ASP.Net 5
Get acquainted with the new ASP.Net 5Get acquainted with the new ASP.Net 5
Get acquainted with the new ASP.Net 5
 
Building APIs with Mule and Spring Boot
Building APIs with Mule and Spring BootBuilding APIs with Mule and Spring Boot
Building APIs with Mule and Spring Boot
 
eSoftHead - groupware solution
eSoftHead - groupware solutioneSoftHead - groupware solution
eSoftHead - groupware solution
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...
A Tale of Two Pizzas: Accelerating Software Delivery with Developer Tools - D...
 
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and Joomla
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
 
Amazon Web Services and PaaS - Enterprise Java for the Cloud Era? - Mark Pric...
Amazon Web Services and PaaS - Enterprise Java for the Cloud Era? - Mark Pric...Amazon Web Services and PaaS - Enterprise Java for the Cloud Era? - Mark Pric...
Amazon Web Services and PaaS - Enterprise Java for the Cloud Era? - Mark Pric...
 
DevOps demystified
DevOps demystifiedDevOps demystified
DevOps demystified
 
A Tale of Two Pizzas: Developer Tools at AWS - DevDay Los Angeles 2017
A Tale of Two Pizzas: Developer Tools at AWS - DevDay Los Angeles 2017A Tale of Two Pizzas: Developer Tools at AWS - DevDay Los Angeles 2017
A Tale of Two Pizzas: Developer Tools at AWS - DevDay Los Angeles 2017
 
Mule ESB Intro
Mule ESB IntroMule ESB Intro
Mule ESB Intro
 
XPages: No Experience Needed
XPages: No Experience NeededXPages: No Experience Needed
XPages: No Experience Needed
 
Picnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable applicationPicnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable application
 

Recently uploaded

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 

Recently uploaded (20)

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 

Merging two big Symfony based applications - PHPCE 2017

  • 1. What we learned by merging two big Symfony based applications Ivo Lukač @ PHPCE 2017, Poland
  • 2. www.netgenlabs.com • Ivo Lukač, co-founder of Netgen
 Also: developer, site builder, architect, consultant, project manager, evangelist, speaker, event organiser, business developer, … • Netgen, web agency, Croatia, ~20 employees • 15 years of experience building complex content- centric web solutions, using eZ Publish since 2004, Symfony since 2013. About me
  • 6. www.netgenlabs.com • Clients are demanding better mixing of content and commerce features • Our stack: • Content managed with eZ Publish / eZ Platform • eCommerce features implemented with Sylius CMS + eCommerce
  • 7. www.netgenlabs.com • eZ Publish CMS open-sourced in 1999 by eZ Systems from Norway • Complete refactoring started in 2011 • eZ Platform, the new generation based on Symfony, released in 2015 • Flexible and customisable content model still the key feature
  • 8. www.netgenlabs.com • Sylius - modern eCommerce based on Symfony2, founded in 2011 by Paweł Jędrzejewski • Modern coding standards, SOA, independent components as bundles, IoC, BDD • Version 1.0 stable released in 2017
  • 11. www.netgenlabs.com Loose integration • A usual approach for integrating 2 or more systems is by establishing remote connections via standard protocols (e.g. http) • Remote systems are treated as black boxes and completely independent • Lastest buzzwords: “microservices” and “serverless”
  • 12. www.netgenlabs.com Symfony - common denominator • Both eZ and Sylius use Symfony full stack as their baseline, they have the same:
 
 database access, template engine, service container, logging, events, caching, security, mailing, assets, environment configuration, translation, …
  • 13. www.netgenlabs.com Tight integration • If 2 systems are built on the same framework and use a lot of the same components - there is a possibility to tightly integrate them on the same application instance • Suggesting new buzzword: “coupling decoupled”
  • 14. www.netgenlabs.com In 2015 we got a suitable project. Our partner Locastic helped with Sylius knowhow First integration was based on:
 - eZ Publish 2014.11
 - Sylius 0.14 
 - Symfony 2.5
  • 16. www.netgenlabs.com Repos • github.com/netgen/ezpublish-community-sylius Symfony application with merged Sylius and eZ Publish • github.com/netgen/NetgenEzSyliusBundle 
 provides features that glue eZ and Sylius together
  • 17. www.netgenlabs.com In the meanwhile • eZ Platform v1 was released, Sylius v1 was released, so we are at the moment working on the new integration: • ezplatform-sylius - new app repo • ezpublish-community-sylius - deprecated • NetgenEzSyliusBundle - master branch to be tagged as version 2
  • 18. www.netgenlabs.com NetgenEzSyliusBundle - the glue • Field type for linking Sylius products inside eZ Platform content objects (translatable, sortable, removable) • Replacing Sylius product routes with related eZ Platform content routes • User provider(s) • Authentication success handler
  • 19. www.netgenlabs.com Working as expected? • Twig template extend feature makes it easy to integrate front side templates • Database configuration can use the same parameters • Dependency injection and service container make it trivial to use “the other system’s” features
  • 21. www.netgenlabs.com 1. Composing 2. Routing 3. Authentication 4. Authorization 5. Admin interface Main challenges
  • 22. www.netgenlabs.com 1. Composing • Even if both systems are full stack Symfony it is possible to run into problems during composing the app. Remember we are talking about merging 2 big apps with many dependencies • Some dependencies could conflict (e.g. Doctrine) • Fix choices:
 - wait for the next release (create PRs to speed this up)
 - some composer magic could help
  • 23. www.netgenlabs.com 1. Composing • It could happen that both systems support different Symfony versions (Sylius 1.0 beta dropped support for Symfony 2 while eZ was still not working with Symfony 3) • Fix choices:
 - basically nothing, just waiting
 - Sylius created a temporary BC branch:
 
 "sylius/sylius": "dev-revert-symfony3-updated as 1.0"
  • 24. www.netgenlabs.com 2. Routing • If any of the systems doesn’t use the system router, they should support the Chain router well (we had a related bug in Sylius needed to be solved) • One side should be prefixed:
 
 sylius:
 resource: "sylius_routing.yml"
 prefix: %ez_sylius.shop_path_prefix%
  • 25. www.netgenlabs.com 2. Routing • As we were showing product with eZ URL, a custom slug for Sylius product was implemented which used eZ URL generator:
 
 netgen_ez_sylius:
 routing:
 generate_url_aliases: true
  • 26. www.netgenlabs.com 3. Authentication • Authenticating users separately should work • Sylius 0.* used FOSUserBundle, • Sylius 1.* uses custom user providers (plural !!!) • eZ uses custom user provider
  • 27. www.netgenlabs.com 3. SSO Authentication • For SSO a security event listener is needed for authenticating the user with both providers • eZ Publish used the user class directly (not the interface) so we couldn’t pass the Sylius user class: we created a PR to be able to do this eventually
  • 28. www.netgenlabs.com 4. Authorisation • For authorisation to work a user object from one system needs to be connected (treated as same) to the related user object in another system • If possible avoid the need for authorisation on both sides. • For example, in our first project we need to connect the admin users from both system but the site users didn’t have to be authorised on eZ, only on Sylius
  • 29. www.netgenlabs.com 4. Connecting related users • To allow manual connecting of users we implemented a script:
 
 ezsylius:user:connect <sylius-user-type> <sylius-user-email> <ez-user-login> • Of course, a post update/create user event support would be a nicer solution
  • 30. www.netgenlabs.com 4. Trouble with Sylius 1.* • For Sylius 1.* lot of refactoring was done with lot of BC brakes. One of the things was the user management part: admin users and normal users got completely separated. • Our authentication and authorisation needed to be done from scratch - we implemented a composite user provider to handle all providers
  • 31. www.netgenlabs.com 5. User interface • If authentication and admin users authorisation is working there is a chance to even merge the admin interface • In most cases probably not a straight forward to do due to different UI frontend architectures. We needed to do a PR to Sylius and also use bundle inheritance
  • 32.
  • 33.
  • 34. www.netgenlabs.com Pros • With both systems working on the same instance the possibility to mesh up things are much bigger • Provides a single admin interface • Problems could be spotted earlier, while in development
  • 35. www.netgenlabs.com Cons • Complexity, good expertise on both systems needed • Depending on 2 roadmaps instead of 1 • Might be performance issues, at least when doing composer update, due to lot of dependencies
  • 36. www.netgenlabs.com What we learned? • A lot about Symfony and Composer :) • To appreciate good roadmaps, semantic versioning, extensible code • Symfony does a lot of lifting, with Flex it might be even more
  • 37. www.netgenlabs.com If you need something similar • Have expertise on Symfony and both systems you want to merge • Check if both roadmaps and release cycles are aligned • Check if PRs are merged in reasonable time • Check what licensing you need to apply
  • 38. www.netgenlabs.com Conclusion • Tightly integrating 2 systems is probably an overkill in lot of situations • Could be worth the effort if you need: • access to all underlaying features • a single UI • SSO and complex authorisation