Symfony e micro (non così tanto) services
-
Upload
michele-orselli -
Category
Software
-
view
182 -
download
3
Transcript of Symfony e micro (non così tanto) services
Symfony e micro (mica tanto)
servizi
A bit of history…
Peaks on gen - jun - aug up to 70 M pg/mth
Peaks during big matches
PaaS Platform as a Service
(almost) Zero configuration
Put the code “on the cloud” and you’re done
In the beginning there was…
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!
micro vs macro?
orchestration?
maintenance?
security?
test?
micro vs macro
How many ways can you split an app?
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)
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?
Lines Of Code
Fits in my head
https://www.infoq.com/presentations/microservices-replaceability-consistency
How services can interact?
Client Side
S1
S2
S3
Page
UI1 UI2
UI3
Client knows the endpoint
Endpoints are public (caching!)
Async loading, progressive enhancement
Server Side
S1
S2
S3
ProxyUI
Client knows only one endpoint
Do not expose the underlying architecture
Provide high level apis
What if something goes wrong?
All services are on subdomains
vxl.calciomercato.com
www.calciomercato.com
Login set cookie on .calciomercato.com
web
vxllogin 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
Test interaction of several services?
S1
S2
S3
SUT
What we learned so far?
Michele OrselliCTO@Ideato
_orso_
micheleorselli / ideatosrl
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