Facebooks BigPipe Done in Java

BigPipe is a way of thinking for web pages. It introduces the concept of pagelets, small parts of the website. BigPipe was implemented at Facebook:

BigPipe is a fundamental redesign of the dynamic web page serving system. The general idea is to decompose web pages into small chunks called pagelets, and pipeline them through several execution stages inside web servers and browsers. This is similar to the pipelining performed by most modern microprocessors: multiple instructions are pipelined through different execution units of the processor to achieve the best performance.

BigPipe renders the structure of a webpage and then adds the content via JavaScript, a kind of inlined AJAX. The result is that users see content earlier and progressivly. Just reload a Facebook page and see how different parts are loaded. This reduces latency and especially changes the perception of users: They think the website is faster. A side effect of splitting the page into pagelets is how each pagelet can be rendered in parallel with asynchronous IO on the server or with an IO thread pool.

With threads, message piping or a worker model very long running service calls do not stop the page from loading, it will only prevent showing the pagelet that is slow. Each thread can have a timeout and you can kill long running or blocking service calls – a SLA for page calls.

Sam Pullaras mustache.java follows the same principles, breaking rendering into parts each with it’s own thread to reduce latency.

I’ve implemented a proof of concept of BigPipe in Java (should run as-is in every servlet container):

This will result in the following HTML code – see how content2 is rendered before content1. Due to threads the order in which content arrives is non-deterministic.

Some problems I’ve encountered:

  • You need the correct content type, content encoding and doc versiom, otherwise the page will not render progressivly
  • Your framework needs to enable flushing the output at certain points, so content is pushed to the browser

I would like to have some framework support and I’m taking a look into how to do this in Play.

423 thoughts on “Facebooks BigPipe Done in Java”

  1. Pingback: human hair
  2. Pingback: hoverboard
  3. Pingback: nike roshe run td
  4. Pingback: nike huarache 1992
  5. Pingback: parajumpers jakke
  6. Pingback: parajumpers norge
  7. Pingback: コピー時計
  8. Pingback: roger vivier shoes
  9. Pingback: roger vivier sale
  10. Pingback: louis vuitton salg
  11. Pingback: parajumpers salg
  12. Pingback: www.710.com
  13. Pingback: DtSPjeIx
  14. Pingback: electric scooter
  15. Pingback: nike air max elite
  16. Pingback: タンク 列車
  17. Pingback: doubles バッグ
  18. Pingback: duvetica通販
  19. Pingback: バッグ 付録
  20. Pingback: coins fifa
  21. Pingback: fut coin websites
  22. Pingback: chrismd fifa coins
  23. Pingback: fifa 13 coins
  24. Pingback: nike outlet
  25. Pingback: アグ 金沢
  26. Pingback: air max shoes
  27. Pingback: FENDI ?? ??
  28. Pingback: nike air pas cher
  29. Pingback: cs go sale
  30. Pingback: cs go aug skins
  31. Pingback: cs go deagle skins
  32. Pingback: csgo trades
  33. Pingback: cheap cosmetics
  34. Pingback: cheap csgo keys
  35. Pingback: cheap csgo key
  36. Pingback: athletic shoes
  37. Pingback: csgo ninja defuse
  38. Pingback: elo history csgo
  39. Pingback: nike pas cher
  40. Pingback: fuck google
  41. Pingback: fuck google
  42. Pingback: fuck google
  43. Pingback: fuck google
  44. Pingback: fuck google
  45. Pingback: best
  46. Pingback: fucoxanthin
  47. Pingback: intelligex
  48. Pingback: intellux
  49. Pingback: probrain
  50. Pingback: radian-c
  51. Pingback: supreme antler
  52. Pingback: testomax
  53. Pingback: TRACKR BRAVO
  54. Pingback: alpha fuel
  55. Pingback: alpha man pro
  56. Pingback: alpha peak
  57. Pingback: alpha xtrm
  58. Pingback: mp43gpfilm
  59. Pingback: anabolic rx24
  60. Pingback: cognifocus
  61. Pingback: garcinia melt
  62. Pingback: Preacher2016
  63. Pingback: max synapse
  64. Pingback: nerventrax
  65. Pingback: premium cleanse
  66. Pingback: testorip
  67. Pingback: testoroar
  68. Pingback: zynev
  69. Pingback: lakfagot
  70. Pingback: pro forskolin
  71. Pingback: forskolin slim
  72. Pingback: garcinia cleanse
  73. Pingback: garcinia xt
  74. Pingback: forskolin fuel
  75. Pingback: hd1080hdkinoonline
  76. Pingback: vitapulse
  77. Pingback: Vita pulse
  78. Pingback: vitapulse reviews
  79. Pingback: vitapulse review
  80. Pingback: pure colon detox
  81. Pingback: more
  82. Pingback: somnapure
  83. Pingback: perfect biotics
  84. Pingback: vitapulse scam
  85. Pingback: vitapulse
  86. Pingback: vita pulse
  87. Pingback: probiotic america
  88. Pingback: lastmeamdyou
  89. Pingback: last olipik game
  90. Pingback: traits
  91. Pingback: Venus Factor ebook
  92. Pingback: Test x180 Ignite
  93. Pingback: Ecomaxx
  94. Pingback: T90 Xplode Reviews
  95. Pingback: Maxtropin
  96. Pingback: Tea tox
  97. Pingback: Test X180 Reviews
  98. Pingback: Test X180 Reviews
  99. Pingback: Breast Actives
  100. Pingback: helppsy
  101. Pingback: vita pulse
  102. Pingback: niagen
  103. Pingback: lampamafussil
  104. Pingback: lastpuob
  105. Pingback: pornovisit
  106. Pingback: kinoklub
  107. Pingback: drama2016
  108. Pingback: jpmsru
  109. Pingback: top2017bloomingme
  110. Pingback: djecrichard2online
  111. Pingback: kino
  112. Pingback: vidiopuksurvivor
  113. Pingback: molodejka14serija
  114. Pingback: djeccc
  115. Pingback: sitemap
  116. Pingback: sitemap5
  117. Pingback: sitemap78
  118. Pingback: site09map
  119. Pingback: 4sezon
  120. Pingback: molodejka14seria
  121. Pingback: molodejka06112016
  122. Pingback: molodejka1415seria
  123. Pingback: molod17
  124. Pingback: listindexme
  125. Pingback: trumpnews
  126. Pingback: molodezhka4seria
  127. Pingback: molodejka
  128. Pingback: molodejka4sezon21s
  129. Pingback: link2016
  130. Pingback: xml18112016
  131. Pingback: xml181120167
  132. Pingback: check my blog
  133. Pingback: Vfx Body Reviews
  134. Pingback: this contact form
  135. Pingback: Source
  136. Pingback: molodejka4seria25
  137. Pingback: read this article
  138. Pingback: my review here
  139. Pingback: Bonuses
  140. Pingback: check here
  141. Pingback: find more info
  142. Pingback: weblink
  143. Pingback: check here
  144. Pingback: my review here
  145. Pingback: Check This Out
  146. Pingback: Half Day Diet Plan
  147. Pingback: read review
  148. Pingback: internet
  149. Pingback: look at this site
  150. Pingback: lastssadsafdsa
  151. Pingback: click
  152. Pingback: Visit Website
  153. Pingback: dig this
  154. Pingback: anchor
  155. Pingback: click here
  156. Pingback: find more
  157. Pingback: see this
  158. Pingback: anchor
  159. Pingback: here
  160. Pingback: her latest blog
  161. Pingback: internet
  162. Pingback: official site
  163. Pingback: my site
  164. Pingback: directory
  165. Pingback: directory
  166. Pingback: check my site
  167. Pingback: dadafdf3ddafdsa
  168. Pingback: dadafdf3ddafdsa
  169. Pingback: click here
  170. Pingback: tires
  171. Pingback: rims
  172. Pingback: wheels
  173. Pingback: click here
  174. Pingback: click here
  175. Pingback: click here
  176. Pingback: click here
  177. Pingback: click here
  178. Pingback: nesaporn
  179. Pingback: happy holi 2017

Comments are closed.