rubyconf brazil 2011
DESCRIPTION
Talk given in SaoPaulo in 2011 for 45mins.Focussing on servver side mash-ups and our use of them in a Strangler patternTRANSCRIPT
Content Fabrics
Or the lost art of server side mash-‐ups.
Me
@nigelfds
github.com/nigelfds
Products
Services
Consulting
XDrelease
test tech optimize
How?our approach
offshore & distributed
App dev
supportThoughtWorks
Delivery
mingle twist cruise
opensourceALM
Melbourne Australia
Mash-‐ups right?
uh.. not really.
The world of big enterprise mess
Content producBon
Content Teams CMS system (Alfresco)
StaBc files served from Apache
End users
Rails on JRuby Another App Yet another app
Tomcat
StaBc InformaBon
Business Processes
The problem: Picking a soluBon
DuplicaBon vs Coupling
hQp://site.com/applicaBon
End users
Alfresco CMS
Rails on JRuby
The Strangler PaQern
Tomcat
Request
Inspired by Linked In
JRuby-‐Rack
Rails
Rails apps deployed as wars
Sitemesh
Webfabric
Alfresco CMS
Response
Refreshing
Refreshing
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Booking - <%= yield :title %></title> <%= fetch("/website/content/integration-template.html").head %>
<%= yield :javascripts %> </head> <body> <%= fetch("/website/content/integration-template.html").div('header') %> <div class="pagelayout single-column-content”> <div class="maincontent"> <%= render 'shared/progress_bar' %> <div class="grid_24"> <%= yield %> </div> </div> <%= fetch("/website/content/integration-template.html").div('footer') %> </div> </body> </html>
Evolving to the
next version
The problem: Content scaling
The general soluBon in compuBng to speed up access to the same informaBon is to use caches.
Scaling by Caching
Scaling using content freshness
<div class="pagelayout single-‐column-‐content"> <%= fetch("/travel/news?filter=SaoPaulo").div('content') %>
<div class="maincontent"> <div class="grid_24">
<%= yield %> </div> </div> </div>
Server side example
Travel Booking Rails App
News Updates Rails App
Get /travel/news?filter=SaoPaulo Accept: application/vnd.company.news+html If-None-Match:… Cache-Control:…
Travel Booking Rails App
News Updates Rails App
<a class="related" href=”/travel/news/13404492/”>Latest Travel News</a>
Client side example
JavaScript in page
News Updates Rails App
Get /travel/news/13404492/ Accept: text/html, */* If-None-Match:… Cache-Control:…
Travel Booking Rails App
News Updates Rails App
<div> <label>…<> <input name="email”/> <label>…<> <input name=”password”/> … </div>
The problem: ConBnuous incremental
deployments
MigraBng content
Batch process
Too many files
Products manufactured by one company, that are packaged and sold by other companies under different brand names.
Enabling mulBple teams
hQp://marBnfowler.com/bliki/SegmentaBonByFreshness.html
hQp://microformats.org/wiki/rest/ahah
hQp://www.sitemesh.org/overview.html
hQp://marBnfowler.com/bliki/StranglerApplicaBon.html
hQp://code.google.com/p/webfabric/