Decoupled cms sunshinephp 2014
-
Upload
lukas-smith -
Category
Technology
-
view
451 -
download
1
description
Transcript of Decoupled cms sunshinephp 2014
Decoupled CMSLukas Smith | @lsmith
!slides created in collaboration with @bergie
Framework
Database File System
Application
We've seen this picture before
Your CMS is a monolith
A great hiding place for spaghetti
It is holding you hostageas you are trying to scale and evolve
Technologies are a fashion
Technologies fail
The internet was built on protocols
It is scalable
It embraces failure
It delegates responsibility empowering clients
It is language agnostic
It all boils down to ..
Decoupling
like we're back in 2000s
Service-Oriented Architecture
Services of a typical web application
!Accounts: login, authorization API: data storage and retrieval WWW: actual web front-end
Most frameworks put these in the same box - why?
You're already using SOA
Atom & RSS
Authentication & identity
Commenting
oEmbed
Analytics
Search
Semantic mark-up
Payment
Infrastructure: SaaS, PaaS
But not everything is ponycorns
...but if you don't know Drupal, you can be faster with Jekyll and Disqus
SOA can take longer
...especially when you're still sketching out your service
API incompatibilities
providers like Heroku can help here
Server for each service can be expensive
less framework support, fewer books, less experience
You're on your own
Many other valid concerns
Backup
Legal
Price
Terms of serviceQuality concerns
Setup delays
Cross DB queries
API changes
PerformanceMissing Features
Down timeEnd of service
User ExperienceLatency
Making SOA manageable
Edge Side Includes
Edge Side Includes! ! ! ! ! <e
si:in
clud
e sr
c=".
." />
!!<esi:include src=".." />
!!!!!!!!!<esi:include src=".." />
<esi:include src=".." />
!!<esi:include src=".." /
>
<esi:include src=".." />
Events, Message Queues
Applying decoupling to PHP applications
Interfacesprotocols on programming language level
bikeshedding instead of defining interfaces?
Framework Interoperability Group
We are not yet tackling the hard stuff
.. did give us PSR-3 for logging
PHP Content Repository Specification
• Adaption of the JCR standard • Contains mostly just interfaces • API covers the needs of CMS • Semi-structured data
• Hierarchical data • Fulltext Search • Versioning • etc.
Composer as the saviordependency management done right
Interface providers in Composer"name": "jackalope/jackalope", "type": "library", ... "provide": { "phpcr/phpcr-implementation": "2.1.0" },
… now you can depend on “phpcr-implementation” instead of a specific provider
Create.js
Decoupling your CMS
Example: Symfony CMF !
• PHPCR o Single API, different storage implementations
• Symfony2 o Off-the-shelf framework
• Create.js o Client-side inline editing with RDFa and JSON-LD
• Varnish o Construct pages from output of different services
Think protocols...and interfaces
...whether it is a library or a hosted service
Reuse existing infrastructure
...not monolithic code
Build services
Questions?!
Lukas Smith | @lsmith !
http://pooteeweet.org https://github.com/lsmith77