Symfony e micro (non così tanto) services

Michele Orselli
Michele OrselliSoftware Developer at spreaker.com
Symfony
e micro (mica tanto)
servizi
A bit of history…
Symfony e micro (non così tanto) services
Peaks on gen - jun - aug up to 70 M pg/mth
Peaks during big matches
Symfony e micro (non così tanto) services
PaaS Platform as a Service
(almost) Zero configuration
Put the code “on the cloud” and you’re done
Symfony e micro (non così tanto) services
In the beginning there was…
Symfony e micro (non così tanto) services
Hard limits on resource (e.g 50 db con)
Deploy via ftp (sf cache mess)
Blackbox: No realtime log, no access
PHP 5.3
Microservices FTW!
Symfony e micro (non così tanto) services
Symfony e micro (non così tanto) services
Symfony e micro (non così tanto) services
micro vs macro?
orchestration?
maintenance?
security?
test?
micro vs macro
How many ways can you split
an app?
Symfony e micro (non così tanto) services
Web: the main web (sf1)
Mobile: mobile version (sf components)
Vxl: community site (sf2 v2.8)
Talk: api for comments, votes, ratings (sf2 v2.8)
Adv: api for ads serving (sf2 v2.8)
Media: api for images mgnt (sf2 v2.8)
Symfony e micro (non così tanto) services
Talk api
/queue

/comments

/comments/totals

/comments/{idComment}

/comments/publish

/comments/{idComment}/votes

/comments/{idComment}/votes/{idVote}

/comments/best-users

/comments/week-best-users

/comments-with-replies

/users/{userId}/statistic

/users/{userId}/comments

/articles/most-commented-today
Media api
/collections

/collections/{idCollection}

/files

/files/multiple

/files/{idFile}

/files/{idFile}/publish
Why small is better?
Symfony e micro (non così tanto) services
Lines Of Code
Fits in my head
https://www.infoq.com/presentations/microservices-replaceability-
consistency
Symfony e micro (non così tanto) services
How services can interact?
Client Side
S1
S2
S3
Page
UI1 UI2
UI3
Symfony e micro (non così tanto) services
Symfony e micro (non così tanto) services
Client knows the endpoint
Endpoints are public (caching!)
Async loading, progressive enhancement
Server Side
S1
S2
S3
ProxyUI
Symfony e micro (non così tanto) services
Symfony e micro (non così tanto) services
Symfony e micro (non così tanto) services
Client knows only one endpoint
Do not expose the underlying architecture
Provide high level apis
Symfony e micro (non così tanto) services
What if something goes wrong?
Symfony e micro (non così tanto) services
All services are on subdomains
vxl.calciomercato.com
www.calciomercato.com
Login set cookie on .calciomercato.com
web
vxl
login Cookie
PHPSESSID: b22j6…
Domain: .calciomercato.com
Api services are token based
talk.calciomercato.com
adv.calciomercato.com
media.calciomercato.com
token expires with session
Deploy
How can we deploy a feature
involving a single service?
How can you deploy a feature
involving n services?
Keep Backward Compatibility!
What if you are removing an endpoint?
What if you are adding an endpoint?
What if you are modifying an endpoint?
Maintenance
n smaller app to keep updated
MicroKernelTrait
Testing
Test a service in isolation
Symfony e micro (non così tanto) services
Symfony e micro (non così tanto) services
Test interaction of several
services?
S1
S2
S3
SUT
What we learned so far?
Michele Orselli
CTO@Ideato
_orso_
micheleorselli / ideatosrl
mo@ideato.it
Thank you!
https://joind.in/talk/92907
https://electric-cloud.com/blog/author/ecloud/page/5/
http://www.magnasoma.com/content/images/Magnasoma-Monolith-3-01.jpg
https://sudo.hailoapp.com/assets/posts/journey-to-microservices/wheel-of-doom-
highlighted.png
http://www.arabamerica.com/wp-content/uploads/2016/05/20160422-the-wire-so-and-so-
animated-gif-1.gif
http://blogs.versionone.com/agile-development/wp-content/uploads/sites/4/2013/04/
ContextMap2.png
https://cdn.infoq.com/statics_s1_20161011-0321_2/resource/articles/qcon-london-2015/en/
resources/8-a.jpg
http://www.uqasar.eu/wp-content/uploads/2014/05/Metrics.jpg
http://pad1.whstatic.com/images/thumb/8/8c/Cheat-at-Card-Games-Step-3.jpg/728px-Cheat-
at-Card-Games-Step-3.jpg
1 of 69

More Related Content

Similar to Symfony e micro (non così tanto) services

Silverlight 4 BriefingSilverlight 4 Briefing
Silverlight 4 BriefingDavid Chou
2.6K views35 slides
Jabber 101Jabber 101
Jabber 101stpeter
1.2K views194 slides
Developing FirefoxOSDeveloping FirefoxOS
Developing FirefoxOSFred Lin
2.9K views82 slides
Fos sintro pres-davFos sintro pres-dav
Fos sintro pres-davParin Sharma
871 views21 slides

Similar to Symfony e micro (non così tanto) services(20)

Silverlight 4 BriefingSilverlight 4 Briefing
Silverlight 4 Briefing
David Chou2.6K views
Jabber 101Jabber 101
Jabber 101
stpeter1.2K views
FFmpeg - the universal multimedia toolkitFFmpeg - the universal multimedia toolkit
FFmpeg - the universal multimedia toolkit
Stefano Sabatini1.2K views
Apache Flex - Enterprise ready GUI frameworkApache Flex - Enterprise ready GUI framework
Apache Flex - Enterprise ready GUI framework
Tomislav Pokrajcic2.4K views
Developing FirefoxOSDeveloping FirefoxOS
Developing FirefoxOS
Fred Lin2.9K views
Fos sintro pres-davFos sintro pres-dav
Fos sintro pres-dav
Parin Sharma871 views
WinbatchWinbatch
Winbatch
Jeff Rabin994 views
Training - Managing .NET/J2EE ProjectsTraining - Managing .NET/J2EE Projects
Training - Managing .NET/J2EE Projects
Shashank Banerjea330 views
Casual Engines 2009Casual Engines 2009
Casual Engines 2009
David Fox4.7K views
Google Android Naver 1212Google Android Naver 1212
Google Android Naver 1212
Yoojoo Jang1.4K views
IntroductionIntroduction
Introduction
Free Open Source Software Technology Lab595 views
OpenOpen
Open
Thanachart Numnonda597 views
BitTorrent on iOSBitTorrent on iOS
BitTorrent on iOS
CocoaHeads France4.3K views
2to32to3
2to3
zubin71403 views
SilverlightSilverlight
Silverlight
vishakpb332 views
Live Mesh Presentation Bruno SvcLive Mesh Presentation Bruno Svc
Live Mesh Presentation Bruno Svc
Wes Yanaga402 views

More from Michele Orselli(20)

Symfony e micro (non così tanto) services