SlideShare a Scribd company logo
SOA with PHP and Symfony
SOA with PHP and Symfony
SOA with PHP and Symfony
• Service-oriented architecture
• Communication over protocol (typically
network)
• Reusable components
• Services are a „black box” for a clients
• Each component is independent and self-
contained
• E-learning platform for primary school
• Addition to books
• Teaching by playing
– Gamification
– Team working
– Personalization (dynamic avatars)
– Virtual currency
SOA with PHP and Symfony
• Producer send message to RabbitMQ server
• Consumer can pick up selected messages
• Consumers are run in CLI
• Consumers can be run in different modes
• We are running consumers in endless loop
Problem: We have fixed date when project will
go live but team wants to work in Agile
methodology.
Solution: Spend few days/weeks for analysing
requirements and plan all sprints to the
deadline.
Problem: Data consistency between all
independent and self-contained components
Solution:
- Advanced Message Queuing Protocol. We have used RabbitMQ
- Communication with components using their external interface
- Using cron jobs for clearing data at nights
- Ignore this, it's not always important and critical for your application
Improve/explore : ESB - Enterprise Service Bus
Problem: How to generate reports based on two
or more self-contained components?
Solution: RabbitMQ
Problem: How to test all components? What about
integration tests of our orchestration level?
Solution:
• PHPUnit in components (mock external components)
• Automated tests written by our testers in SOAP UI
Improve:
• More tests 
• Behat
• PHPSpec
Problem: Performance of the whole application
doesn’t satisfy us
Solution:
• Disable unused components like: Session, Security
• Disable Doctrine logging
• Proper configuration of Symfony logger
• Always use Composer class loading optimization
• Too many listeners on HTTP requests
• Use APC, Xcache or any other PHP accelerator
• Use ApcClassLoader or XcacheClassLoader
• HTTP cache (Varnish)
Problem: Processing of messages was very slow
and memory leaks in consumers.
Solution: Clean up after yourself
• Use unset() method
• Doctrine methods: free(), detach(), clear()
Problem: MySQL errors:
• 2013: Lost connection to MySQL server
• 2006: MySQL server has gone away
• 2003: Can't connect to MySQL server
Solution: Catch all those exceptions and try to
reconnect to the database server. We have set
up also some timeout between all retries.
Problem: Can I trust consumer scripts? What with
situation when consumer will have problem with
connection with database etc. Exception is thrown
and message can be lost.
Solution:
• Creat failover files
• Catch all exceptions
• Log message into that file.
• Create mechanism for processing failed messages
Problem: We are using Memcached but QPS
(Query Per Second) of the MySQL server doesn't
satisfy us
Solution: Configure read/write split in your
database and prepare separate connections in
your application
Problem: Performance of the database layer still doesn’t
satisfy us
Solution: Monitor database queries during development
How:
• Use Symfony profiler
• Log all database queries to the temporary file on your
dev environment. Then use „tail –f” command to
monitor all queries during requests
• Use EXPLAIN on more complicated queries
Problem: Doctrine performance is unsatisfactory.
Moreover Doctrine create many unnecessary queries.
Solution:
• Use DQL instead Doctrine findAll() method
• Use native query for more complicated queries
• Avoid entity mapping when it’s not necessary
(hydration mode)
• Use „extra lazy” fetching strategy for associations
• For big collections fetch only necessary fields
Problem: How to monitor application? How detect
problems before they will become a serious?
Solution: Monitoring software
• New Relic
• Nagios
Improve: Logstash + Kibana + Elasticsearch
• Symfony 2.3
• PHPUnit
• SoapUI
• RabbitMQ
• MySQL (Percona)
• Elasticsearch
• Jenkins
• Memcached
• Nagios
• New Relic
• First project on new framework
• First use of Doctrine
• Run all Symfony2 console commands with --env=prod parameter
• Write your own wrappers to all main external libraries
• Use Vagrant or Docker
• Run load tests on filled database
• Automate your processes (ie. Ant + Jenkins)
• Add created_date and modified_date to all tables (use MySQL triggers)
Quetions?
Ad

Recommended

PDF
Slides: NoSQL Data Modeling Using JSON Documents – A Practical Approach
DATAVERSITY
 
PPTX
Mining Data Streams
SujaAldrin
 
PDF
Big data Analytics
ShivanandaVSeeri
 
PPTX
Comparing three data ingestion approaches where Apache Kafka integrates with ...
HostedbyConfluent
 
PDF
BIG DATA.pdf
naveenlingala2
 
PDF
Apache Spark - Basics of RDD | Big Data Hadoop Spark Tutorial | CloudxLab
CloudxLab
 
PDF
The CAP Theorem
Aleksandar Bradic
 
PDF
Big Data Applications | Big Data Analytics Use-Cases | Big Data Tutorial for ...
Edureka!
 
PPTX
Dynamodb Presentation
advaitdeo
 
PDF
Natural Language Processing
Toine Bogers
 
PDF
RedisConf17 - Lyft - Geospatial at Scale - Daniel Hochman
Redis Labs
 
PPTX
Key-Value NoSQL Database
Heman Hosainpana
 
PDF
Introduction to HBase
Avkash Chauhan
 
PPTX
Pig Tutorial | Apache Pig Tutorial | What Is Pig In Hadoop? | Apache Pig Arch...
Simplilearn
 
PPT
Natural Language Processing
Yasir Khan
 
PPTX
Multi dimensional model vs (1)
JamesDempsey1
 
PDF
2016 mORMot
Arnaud Bouchez
 
PDF
Usage of regular expressions in nlp
eSAT Journals
 
PDF
Symfony in microservice architecture
Daniele D'Angeli
 
PPTX
A SOA approximation on symfony
Joseluis Laso
 
PDF
Services Oriented Architecture with PHP and MySQL
Joe Stump
 
PDF
Microservice architecture
Xavier Fornés Arrabal
 
PDF
Clean architecture with ddd layering in php
Leonardo Proietti
 
PDF
Go from PHP engineer's perspective
Sobit Akhmedov
 
PDF
Genesi di una tecnologia, dalla ricerca all'industria...
italianaSoftware
 
PDF
Microservizi, scenari del prossimo e del lontano futuro
italianaSoftware
 
PDF
Industria 4.0 - Come verrà rivoluzionata l'industria italiana
italianaSoftware
 
PPTX
ASP.NET MVC Fundamental
ldcphuc
 
PDF
La rivoluzione dei Microservizi
italianaSoftware
 
PDF
(micro)services avec Symfony et Tolerance
Samuel ROZE
 

More Related Content

What's hot (10)

PPTX
Dynamodb Presentation
advaitdeo
 
PDF
Natural Language Processing
Toine Bogers
 
PDF
RedisConf17 - Lyft - Geospatial at Scale - Daniel Hochman
Redis Labs
 
PPTX
Key-Value NoSQL Database
Heman Hosainpana
 
PDF
Introduction to HBase
Avkash Chauhan
 
PPTX
Pig Tutorial | Apache Pig Tutorial | What Is Pig In Hadoop? | Apache Pig Arch...
Simplilearn
 
PPT
Natural Language Processing
Yasir Khan
 
PPTX
Multi dimensional model vs (1)
JamesDempsey1
 
PDF
2016 mORMot
Arnaud Bouchez
 
PDF
Usage of regular expressions in nlp
eSAT Journals
 
Dynamodb Presentation
advaitdeo
 
Natural Language Processing
Toine Bogers
 
RedisConf17 - Lyft - Geospatial at Scale - Daniel Hochman
Redis Labs
 
Key-Value NoSQL Database
Heman Hosainpana
 
Introduction to HBase
Avkash Chauhan
 
Pig Tutorial | Apache Pig Tutorial | What Is Pig In Hadoop? | Apache Pig Arch...
Simplilearn
 
Natural Language Processing
Yasir Khan
 
Multi dimensional model vs (1)
JamesDempsey1
 
2016 mORMot
Arnaud Bouchez
 
Usage of regular expressions in nlp
eSAT Journals
 

Viewers also liked (20)

PDF
Symfony in microservice architecture
Daniele D'Angeli
 
PPTX
A SOA approximation on symfony
Joseluis Laso
 
PDF
Services Oriented Architecture with PHP and MySQL
Joe Stump
 
PDF
Microservice architecture
Xavier Fornés Arrabal
 
PDF
Clean architecture with ddd layering in php
Leonardo Proietti
 
PDF
Go from PHP engineer's perspective
Sobit Akhmedov
 
PDF
Genesi di una tecnologia, dalla ricerca all'industria...
italianaSoftware
 
PDF
Microservizi, scenari del prossimo e del lontano futuro
italianaSoftware
 
PDF
Industria 4.0 - Come verrà rivoluzionata l'industria italiana
italianaSoftware
 
PPTX
ASP.NET MVC Fundamental
ldcphuc
 
PDF
La rivoluzione dei Microservizi
italianaSoftware
 
PDF
(micro)services avec Symfony et Tolerance
Samuel ROZE
 
PDF
Implementazione di una soluzione a microservizi: benifici organizzativi ed ec...
italianaSoftware
 
PDF
Behavioral driven development with Behat
Promet Source
 
PDF
Microservice Teststrategie mit Symfony2
Per Bernhardt
 
PPTX
A soa approximation on symfony
Carlos Agudo Belloso
 
PDF
PHP is the King, nodejs the prince and python the fool
Alessandro Cinelli (cirpo)
 
KEY
Telephony with OpenShift Twilio and MongoDB
Mark Atwood
 
PDF
Devops, Cloud e Container
italianaSoftware
 
PPTX
Architecture orientée service (SOA)
Klee Group
 
Symfony in microservice architecture
Daniele D'Angeli
 
A SOA approximation on symfony
Joseluis Laso
 
Services Oriented Architecture with PHP and MySQL
Joe Stump
 
Microservice architecture
Xavier Fornés Arrabal
 
Clean architecture with ddd layering in php
Leonardo Proietti
 
Go from PHP engineer's perspective
Sobit Akhmedov
 
Genesi di una tecnologia, dalla ricerca all'industria...
italianaSoftware
 
Microservizi, scenari del prossimo e del lontano futuro
italianaSoftware
 
Industria 4.0 - Come verrà rivoluzionata l'industria italiana
italianaSoftware
 
ASP.NET MVC Fundamental
ldcphuc
 
La rivoluzione dei Microservizi
italianaSoftware
 
(micro)services avec Symfony et Tolerance
Samuel ROZE
 
Implementazione di una soluzione a microservizi: benifici organizzativi ed ec...
italianaSoftware
 
Behavioral driven development with Behat
Promet Source
 
Microservice Teststrategie mit Symfony2
Per Bernhardt
 
A soa approximation on symfony
Carlos Agudo Belloso
 
PHP is the King, nodejs the prince and python the fool
Alessandro Cinelli (cirpo)
 
Telephony with OpenShift Twilio and MongoDB
Mark Atwood
 
Devops, Cloud e Container
italianaSoftware
 
Architecture orientée service (SOA)
Klee Group
 
Ad

Similar to SOA with PHP and Symfony (20)

PDF
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
vanphp
 
PDF
2019 PHP Serbia - Boosting your performance with Blackfire
Marko Mitranić
 
PDF
Scaling with Symfony - PHP UK
Ricard Clau
 
PDF
Symfony War Stories
Jakub Zalas
 
PDF
DDD with Behat
Anton Serdyuk
 
PDF
2019 StartIT - Boosting your performance with Blackfire
Marko Mitranić
 
PDF
Tool up your lamp stack
AgileOnTheBeach
 
PDF
Tool Up Your LAMP Stack
Lorna Mitchell
 
ODP
Php Site Optimization
Amit Kejriwal
 
PPT
Opac labs overview-pr1.0
opaclabs
 
PDF
Full stack development
Pavlo Iuriichuk
 
PPT
Software Engineering in PHP
M A Hossain Tonu
 
PDF
Fixing twitter
Roger Xia
 
PDF
Fixing_Twitter
liujianrong
 
PDF
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
smallerror
 
PDF
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
xlight
 
PPT
scale_perf_best_practices
webuploader
 
PPTX
Best Practices in PHP Application Delivery
Ana Maria Valarezo
 
PPT
How to run an Enterprise PHP Shop
Jim Plush
 
PPTX
Agile Tools for PHP
philipjting
 
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
vanphp
 
2019 PHP Serbia - Boosting your performance with Blackfire
Marko Mitranić
 
Scaling with Symfony - PHP UK
Ricard Clau
 
Symfony War Stories
Jakub Zalas
 
DDD with Behat
Anton Serdyuk
 
2019 StartIT - Boosting your performance with Blackfire
Marko Mitranić
 
Tool up your lamp stack
AgileOnTheBeach
 
Tool Up Your LAMP Stack
Lorna Mitchell
 
Php Site Optimization
Amit Kejriwal
 
Opac labs overview-pr1.0
opaclabs
 
Full stack development
Pavlo Iuriichuk
 
Software Engineering in PHP
M A Hossain Tonu
 
Fixing twitter
Roger Xia
 
Fixing_Twitter
liujianrong
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
smallerror
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
xlight
 
scale_perf_best_practices
webuploader
 
Best Practices in PHP Application Delivery
Ana Maria Valarezo
 
How to run an Enterprise PHP Shop
Jim Plush
 
Agile Tools for PHP
philipjting
 
Ad

Recently uploaded (20)

PDF
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
PDF
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
PDF
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
PDF
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
PPTX
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
PDF
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
PDF
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
PDF
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
PDF
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
PDF
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
PDF
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PPTX
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
PDF
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 

SOA with PHP and Symfony

  • 4. • Service-oriented architecture • Communication over protocol (typically network) • Reusable components • Services are a „black box” for a clients • Each component is independent and self- contained
  • 5. • E-learning platform for primary school • Addition to books • Teaching by playing – Gamification – Team working – Personalization (dynamic avatars) – Virtual currency
  • 7. • Producer send message to RabbitMQ server • Consumer can pick up selected messages • Consumers are run in CLI • Consumers can be run in different modes • We are running consumers in endless loop
  • 8. Problem: We have fixed date when project will go live but team wants to work in Agile methodology. Solution: Spend few days/weeks for analysing requirements and plan all sprints to the deadline.
  • 9. Problem: Data consistency between all independent and self-contained components Solution: - Advanced Message Queuing Protocol. We have used RabbitMQ - Communication with components using their external interface - Using cron jobs for clearing data at nights - Ignore this, it's not always important and critical for your application Improve/explore : ESB - Enterprise Service Bus
  • 10. Problem: How to generate reports based on two or more self-contained components? Solution: RabbitMQ
  • 11. Problem: How to test all components? What about integration tests of our orchestration level? Solution: • PHPUnit in components (mock external components) • Automated tests written by our testers in SOAP UI Improve: • More tests  • Behat • PHPSpec
  • 12. Problem: Performance of the whole application doesn’t satisfy us Solution: • Disable unused components like: Session, Security • Disable Doctrine logging • Proper configuration of Symfony logger • Always use Composer class loading optimization • Too many listeners on HTTP requests • Use APC, Xcache or any other PHP accelerator • Use ApcClassLoader or XcacheClassLoader • HTTP cache (Varnish)
  • 13. Problem: Processing of messages was very slow and memory leaks in consumers. Solution: Clean up after yourself • Use unset() method • Doctrine methods: free(), detach(), clear()
  • 14. Problem: MySQL errors: • 2013: Lost connection to MySQL server • 2006: MySQL server has gone away • 2003: Can't connect to MySQL server Solution: Catch all those exceptions and try to reconnect to the database server. We have set up also some timeout between all retries.
  • 15. Problem: Can I trust consumer scripts? What with situation when consumer will have problem with connection with database etc. Exception is thrown and message can be lost. Solution: • Creat failover files • Catch all exceptions • Log message into that file. • Create mechanism for processing failed messages
  • 16. Problem: We are using Memcached but QPS (Query Per Second) of the MySQL server doesn't satisfy us Solution: Configure read/write split in your database and prepare separate connections in your application
  • 17. Problem: Performance of the database layer still doesn’t satisfy us Solution: Monitor database queries during development How: • Use Symfony profiler • Log all database queries to the temporary file on your dev environment. Then use „tail –f” command to monitor all queries during requests • Use EXPLAIN on more complicated queries
  • 18. Problem: Doctrine performance is unsatisfactory. Moreover Doctrine create many unnecessary queries. Solution: • Use DQL instead Doctrine findAll() method • Use native query for more complicated queries • Avoid entity mapping when it’s not necessary (hydration mode) • Use „extra lazy” fetching strategy for associations • For big collections fetch only necessary fields
  • 19. Problem: How to monitor application? How detect problems before they will become a serious? Solution: Monitoring software • New Relic • Nagios Improve: Logstash + Kibana + Elasticsearch
  • 20. • Symfony 2.3 • PHPUnit • SoapUI • RabbitMQ • MySQL (Percona) • Elasticsearch • Jenkins • Memcached • Nagios • New Relic
  • 21. • First project on new framework • First use of Doctrine
  • 22. • Run all Symfony2 console commands with --env=prod parameter • Write your own wrappers to all main external libraries • Use Vagrant or Docker • Run load tests on filled database • Automate your processes (ie. Ant + Jenkins) • Add created_date and modified_date to all tables (use MySQL triggers)

Editor's Notes

  • #3: Nazywam się Michał Schroeder, dla zainteresowanych podaję też mój adres e-mail. Jakby ktoś się wstydził zagadać do mnie dzisiaj w przerwie, bądź też po prezentacjach, to może śmiało skontaktować się ze mną mailowo.
  • #4: Opowiem Wam dzisiaj trochę o moim projekcie w którym uczestniczyłem przez ostatnie 12 miesięcy. W prezentacji poruszę kilka różnych tematów i zagadnień. Będzie o bazach danych, wydajności, Symfony2, architekturze i asynchronicznej komunikacji między niezależnymi komponentami. Część rzeczy będzie uniwersalna, które będzie można wykorzystać w projektach nie tylko opartych na architekturze SOA. Wiele rzeczy może się niektórym wydać oczywista, ale mam nadzieję że każdy wyniesie z tej prezentacji coś nowego i pożytecznego. Z drugiej strony nie będę się też wdawał w niskopoziomowe szczegóły i tłumaczył np. co to jest Vagrant, REST czy jak się powinno korzystać z tych narzędzi. W większości były już prezentacje na te tematy na poprzednich edycjach PHPers. Polecam notować sobie ewentualne hasła, które Was zainteresują i wtedy w przerwie bądź po prezentacjach dopytać o szczegóły jakie Was interesują. Aby nie tracić czasu, zaczynamy!
  • #5: Zacznę od odpowiedzi na pytanie, co to jest SOA dla tych osób które nie miały styczności z tym pojęciem. Jest to service oriented architecture czyli architektura oparta o serwisy czyli małe klocuszki z których budujemy większa aplikację Komponenty komunikują się pomiędzy sobą przez ustalony protokół, przeważnie jest to protokół sieciowy w przypadku naszej aplikacji był to REST Głównym założeniem tej architektury jest to aby każdy komponent był reużywalny (np. komponent użytkownika, szkoły, klasy) Każdy serwis jest „czarną skrzynką” dla klientów, klient nie wie jak jakaś funkcjonalność jest zaimplementowana, w jakiej technologii itd. Dla niego ważne jest to że spełnia on swoją rolę. Każdy serwis jest też samodzielny i niezależny co oznacza np. bark powiązań na poziomie bazy danych. Brak JOIN-ów co powoduje zwiększoną ilość zapytań do bazy.
  • #7: - Omówienie diagramu. - SOA była dla nas nowa, pierwsze nasze podejście do takiej architektury. - Frontend robiła firma zewnętrzna w Javie
  • #11: Jest to tylko w draft więc nie można się na to zapinać bo nie wiadomo czy nie zostanie to np. docelowo usunięte lub nie pojawi się w ostatecznej specyfikacji pod inną nazwą Problem z narzędziami które to wspierają
  • #12: Jak już wspomniałem wcześniej, na wcześniejszym jednym z pierwszych slajdów, architektura SOA opiera się na niezależnych komponentach. Jak zatem zapewnić spójność danych pomiędzy wszystkimi komponentami? Łatwo sobie wyobrazić sytuacje w której np. usuwamy użytkownika z naszego systemu ale cały czas zostają powiązania użytkownik-klasa czy użytkownik-szkoła. Myśmy w naszym projekcie wykorzystali do tego oprogramowanie RabbitMQ. Jak to działa? W skrócie jest to tak że mamy główny serwer RabbitMQ zainstalowany na serwerze który nasłuchuje na wiadomości. Przykładowo w komponencie USER po usunięciu użytkownika wysyłamy do tego serwera wiadomość „użytkownik został usunięty” wraz z jego ID. Serwer przekazuje dalej w świat taką wiadomość. Dodatkowo w systemie jest 5 innych komponentów, które nasłuchują takiej wiadomości. Po odebraniu jej mogą wykonać jakieś kroki, w naszym przypadku np. pousuwać powiązania użytkownika z szkołą, klasą itd. Czasem używaliśmy interfejsów które wystawiają poszczególne komponenty aby wykonać dodatkowo jakieś zadanie np. przy usuwaniu użytkownika. Minusem tego jest to że w ten sposób wiążemy komponenty, tzn komponent USER musi wiedzieć że jest tam gdzieś komponent szkoła czy klasa gdzie trzeba też tego użytkownika usunąć. Dodatkowo jest to też czas potrzebny na wszystkie żądania. Kolejnym rozwiązaniem jest możliwość stworzenia zadań CRON które w nocy będą usuwać wszystkie zbędne „śmieci” Czasem bywa też tak że takie powiązania i „śmieci” nam nie przeszkadzają w żaden sposób. Wtedy po prostu się tym nie przejmujemy.
  • #13: Problem jaki się pojawił to jak wygenerować raport, który bazuje na dwóch lub więcej komponentach? Załóżmy że mamy wyświetlić raport wyników ucznia z danej szkoły w którym będzie imię, nazwisko, klasa do której należy oraz wyniki ucznia wg przedmiotów. W normalnej jednoklockowej aplikacji wykorzystalibyśmy JOIN-y na bazie danych. Jednak tutaj nie możemy tego zrobić, więc jak w takim razie podejść do tematu? Po raz kolejny rozwiązaniem tego problemu okazał się w naszym wypadku RabbitMQ. Załóżmy że mamy ucznia który sobie zapisuje wyniki swojego zadania. Wyniki te wysyłamy na kolejkę RabbitMQ i komponent RESULT zapomina o tym. Z tej kolejki dane o wyniku pobiera 5 raportów, są to osobne consumery, które zapisują lub aktualizują swoje dane.
  • #15: Wyłączamy niepotrzebne i nieużywane w naszej aplikacji komponenty Wyłączamy logowanie w Doctrine Okroić logowanie Symfony2 Zbyt duża ilość listnerów na requesty HTTP Używać cache przy autoloaderze
  • #16: Kolejny problem jaki się pojawił był związany z RabbitMQ. W sumie to nie był problem z Rabbitem a naszym podejściem do pisania consumerów. Potraktowaliśmy konsumery jak typową aplikację webową gdzie mamy request do serwera, coś tam przetwarzamy, pobieramy z bazy czy coś do niej zapisujemy wysyłamy odpowiedź i to koniec życia requestu. Przyczyn było kilka jednak najważniejsza