Top Banner
Content Fabrics Or the lost art of server side mashups.
38

RubyConf Brazil 2011

Dec 05, 2014

Download

Technology

Nigel Fernandes

Talk given in SaoPaulo in 2011 for 45mins.

Focussing on servver side mash-ups and our use of them in a Strangler pattern
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: RubyConf Brazil 2011

Content  Fabrics  

Or  the  lost  art  of  server  side  mash-­‐ups.  

Page 2: RubyConf Brazil 2011

Me

Page 3: RubyConf Brazil 2011

@nigelfds  

github.com/nigelfds  

Page 4: RubyConf Brazil 2011

Products

Services

Consulting

XDrelease

test tech optimize

How?our approach

offshore & distributed

App dev

supportThoughtWorks

Delivery

mingle twist cruise

opensourceALM

Page 5: RubyConf Brazil 2011
Page 6: RubyConf Brazil 2011

Melbourne  Australia  

Page 7: RubyConf Brazil 2011

Mash-­‐ups  right?  

Page 8: RubyConf Brazil 2011

uh..  not  really.    

Page 9: RubyConf Brazil 2011

The  world  of  big  enterprise    mess  

Page 10: RubyConf Brazil 2011
Page 11: RubyConf Brazil 2011

Content  producBon  

Content  Teams   CMS  system  (Alfresco)  

StaBc  files  served  from    Apache  

End  users  

Page 12: RubyConf Brazil 2011

Rails  on  JRuby  Another  App   Yet  another  app  

Tomcat  

StaBc  InformaBon  

Business  Processes  

Page 13: RubyConf Brazil 2011

The  problem:  Picking  a  soluBon    

Page 14: RubyConf Brazil 2011

DuplicaBon  vs  Coupling  

Page 15: RubyConf Brazil 2011

hQp://site.com/applicaBon  

End  users  

Alfresco  CMS  

Rails  on  JRuby    

Page 16: RubyConf Brazil 2011

The  Strangler  PaQern  

Page 17: RubyConf Brazil 2011

Tomcat  

Request  

Inspired  by  Linked  In  

JRuby-­‐Rack  

Rails  

Rails  apps  deployed  as  wars  

Sitemesh  

Webfabric  

Alfresco  CMS  

Response  

Page 18: RubyConf Brazil 2011

Refreshing

Refreshing

Page 19: RubyConf Brazil 2011

<!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>

Page 20: RubyConf Brazil 2011

Evolving    to  the  

next  version  

Page 21: RubyConf Brazil 2011

The  problem:    Content  scaling  

Page 22: RubyConf Brazil 2011

The  general  soluBon  in  compuBng  to  speed  up  access  to  the  same  informaBon  is  to  use  caches.    

Page 23: RubyConf Brazil 2011

Scaling  by  Caching  

Page 24: RubyConf Brazil 2011

Scaling  using  content  freshness  

Page 25: RubyConf Brazil 2011

<div  class="pagelayout  single-­‐column-­‐content">              <%=  fetch("/travel/news?filter=SaoPaulo").div('content')  %>  

           <div  class="maincontent">    <div  class="grid_24">  

                         <%=  yield  %>                                          </div>              </div>  </div>  

Page 26: RubyConf Brazil 2011

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>

Page 27: RubyConf Brazil 2011

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>

Page 28: RubyConf Brazil 2011

The  problem:  ConBnuous  incremental  

deployments    

Page 29: RubyConf Brazil 2011

MigraBng  content  

Page 30: RubyConf Brazil 2011

Batch  process    

Page 31: RubyConf Brazil 2011
Page 32: RubyConf Brazil 2011

Too  many  files  

Page 33: RubyConf Brazil 2011

Products  manufactured  by  one  company,  that  are  packaged  and  sold  by  other  companies  under  different  brand  names.  

Page 34: RubyConf Brazil 2011
Page 35: RubyConf Brazil 2011

Enabling  mulBple  teams  

Page 36: RubyConf Brazil 2011

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/  

Page 37: RubyConf Brazil 2011
Page 38: RubyConf Brazil 2011