Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Leaving jsps in the dust
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Veena Basavaraj
June 30, 2012
Technology
2
430
Leaving jsps in the dust
LinkedIn moving to client templates for the web
Veena Basavaraj
June 30, 2012
Tweet
Share
More Decks by Veena Basavaraj
See All by Veena Basavaraj
Dust and web-performance at LinkedIn
vybs
1
210
CuriousCaseOfDust.pdf
vybs
1
300
Other Decks in Technology
See All in Technology
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
260
【Oracle Cloud ウェビナー】[Oracle AI Database + AWS] Oracle Database@AWSで広がるクラウドの新たな選択肢とAI時代のデータ戦略
oracle4engineer
PRO
2
170
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.5k
OpenShiftでllm-dを動かそう!
jpishikawa
0
120
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
630
AI駆動開発を事業のコアに置く
tasukuonizawa
1
260
Tebiki Engineering Team Deck
tebiki
0
24k
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
ClickHouseはどのように大規模データを活用したAIエージェントを全社展開しているのか
mikimatsumoto
0
260
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
190
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
150
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
120
Code Reviewing Like a Champion
maltzj
527
40k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
120
KATA
mclloyd
PRO
34
15k
From π to Pie charts
rasagy
0
120
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
New Earth Scene 8
popppiees
1
1.5k
Exploring anti-patterns in Rails
aemeredith
2
250
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
290
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Transcript
Leaving jsps in the dust @vybs
We are pi@linkedIn
front-end infrastructure
Goal(s)
In the beginning... Site-Speed Site-Scale +
What is the Problem?
But... Site-Speed Site-Scale Developer Velocity
Simple things should be dead easy
Build Quick, Iterate More
front-end infrastructure now became....
Static Vs Dynamic Jruby Node.js Grails
Anyone notice a bad pattern?
Do once, Do the same twice, Do the same thrice...!
How does this work effectively in mobile?
Still building heavy pages not apps
We created a few more problems indeed!
How did we solve them?
Unification • Javascript Templates, CDN caching • Write once •
JSON for data • One Standard • Event-ed Server as JSON Aggregator + JS V8 engine • Scale once
JavaScript templates • Evaluated tons, handlebars, dust, mustache • Good:
Simple, less logic, 4KB, precompiled to javascript, performance is a feature • Bad: None are mature enough, i18n/ formatters not out of the box
_t = “Hello {name}! You have {count} new messages from
{#people} {name}, {/people} ”; json = { "name": ”James", "count": 2, “people” : [{ “name” : “Jim”, “distance” : “2” },{ “name”: ”Eran” “distance” : “1”} ] } Hello James! You have 2 new messages from Jim, Eran! !dust.render(_t, json, function(error, data) {! $(“mydiv”).html(data);! }!
Dust - *less logic • Simple, DRY • loops, conditionals,
partials, inheritance {#people} {>”/path/degree_icon_{distance}”/} {/people}
Dust • Client Helpers for extensions, reusability • Rendering logic,
math, i18n • @if, @select, @lte, @ceil, @i18n, @form {#people} <li class="card {@select key=“distance”} {@lte value=“1”/} {@i18n text=“first degree”/} {@gt value=“1”/} {@i18n text=“second degree”/} {/select} </li> {/people}
! on client • Server side precompiled to JS •
Rendering times on client snappy
! on client • Server side processed helper tags •
auto-generate template dependencies {#people} {“>degree_icon”/} {/people}
! on client • Dust Preprocessed helper tags • leverage
JVM based i18n, formatting and A/B testing • creates template driven, context based JSON {#people} {@ss.fmt key=”fmt_name” type=“name” value=”{name}”/} {/people} {#people} {fmt_name} {/people} Client template/ js “people” : [{ “name” : “Joe Jada”, “fmt_name” : “Joe J”, “distance” : “2” },{ “name”: ”Jade Pink” “fmt_name” : “Jade P”, “distance” : “1”} ] } Server Source template uses
! on client • No javascript, SEO pages • Seamless
rendering of dust on the server using V8
data layer JSON JSON Browser UI /JSON Aggregator V8 Page
apps Module Module JSON CDN caching content delivery Static Assets static content js, css, templates linkedin.com
linkedin.com/people/pymk
we dust! https://github.com/linkedin/dustjs https://github.com/linkedin/Lu https://github.com/linkedin/inject