Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Bloom Filters for
Web Caching
Felix Gessert
Felix.gessert@baqend.com
@baqendcom
Presentation
is loading
Average: 9,3s
The Latency Problem
Loading…
-1% Revenue
100ms
-9% Visitors
400ms
500ms
-20% Traffic
If perceived speed is such an
import factor for business
...what causes slow page load times?
The Problem
Three Bottlenecks: Latency, Backend & Frontend
High Latency
Backend
Frontend
Network Latency: Impact
I. Grigorik, High performance browser networking.
O’Reilly Media, 2013.
Network Latency: Impact
I. Grigorik, High performance browser networking.
O’Reilly Media, 2013.
2× Bandwidth = Same Load T...
Goal: Low-Latency for Dynamic Content
By Serving Data from Ubiquitous Web Caches
Low Latency
Less Processing
Idea: use HTTP Caching for dynamic data (e.g. queries)
Our Approach
Caching Dynamic Data with Bloom filters
How to keep th...
In a nutshell
Problem: changes cause stale data
Stale
Data
In a nutshell
Problem: changes cause stale data
In a nutshell
Solution: Proactively Revalidate Data
Cache Sketch (Bloom filter)
updateIs still fresh? 1 0 11 0 0 10 1 1
Innovation
Solution: Proactively Revalidate Data
F. Gessert, F. Bücklers, und N. Ritter, „ORESTES: a Scalable
Database-as-...
 Bit array of length m and k independent hash functions
 insert(obj): add to set
 contains(obj): might give a false pos...
1 4 020
Browser
Cache
CDN
Bloom filters for Caching
End-to-End Example
1 4 020
Browser
Cache
CDN
Bloom filters for Caching
End-to-End Example
Gets Time-to-Live
Estimation by the server
1 4 020
Browser
Cache
CDN
Bloom filters for Caching
End-to-End Example
1 4 020
Browser
Cache
CDN
Bloom filters for Caching
End-to-End Example
1 4 020
purge(obj)
hashB(oid)hashA(oid)
3
Browser
Cache
CDN
1
Bloom filters for Caching
End-to-End Example
1 4 020 31 1 110
Flat(Counting Bloomfilter)
Browser
Cache
CDN
1
Bloom filters for Caching
End-to-End Example
1 4 020 31 1 110
hashB(oid)hashA(oid)
Browser
Cache
CDN
1
Bloom filters for Caching
End-to-End Example
1 4 020 31 1 110
hashB(oid)hashA(oid)
Browser
Cache
CDN
1
Bloom filters for Caching
End-to-End Example
1 4 020
hashB(oid)hashA(oid)
1 1 110
Browser
Cache
CDN
Bloom filters for Caching
End-to-End Example
1 4 020
hashB(oid)hashA(oid)
1 1 110
Browser
Cache
CDN
Bloom filters for Caching
End-to-End Example
𝑓 ≈ 1 − 𝑒−
𝑘𝑛
𝑚
𝑘
𝑘 = ...
Show me some Code!
End-to-End Example
<script src="//baqend.global.ssl.fastly.net/js-
sdk/latest/baqend.min.js"></script>
...
Show me some Code!
End-to-End Example
<script src="//baqend.global.ssl.fastly.net/js-
sdk/latest/baqend.min.js"></script>
...
Ziel mit InnoRampUpOur Mission at Baqend:
„Kick load times in the
ass using Bloom filters“
www.baqend.com
@Baqendcom
Upcoming SlideShare
Loading in …5
×
Upcoming SlideShare
Web Performance – die effektivsten Techniken aus der Praxis
Next
Download to read offline and view in fullscreen.

1

Share

Download to read offline

Bloom Filters for Web Caching - Lightning Talk

Download to read offline

Lightning Talk from HH.JS June 15/2016.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Bloom Filters for Web Caching - Lightning Talk

  1. 1. Bloom Filters for Web Caching Felix Gessert Felix.gessert@baqend.com @baqendcom
  2. 2. Presentation is loading
  3. 3. Average: 9,3s The Latency Problem Loading… -1% Revenue 100ms -9% Visitors 400ms 500ms -20% Traffic
  4. 4. If perceived speed is such an import factor for business ...what causes slow page load times?
  5. 5. The Problem Three Bottlenecks: Latency, Backend & Frontend High Latency Backend Frontend
  6. 6. Network Latency: Impact I. Grigorik, High performance browser networking. O’Reilly Media, 2013.
  7. 7. Network Latency: Impact I. Grigorik, High performance browser networking. O’Reilly Media, 2013. 2× Bandwidth = Same Load Time ½ Latency ≈ ½ Load Time
  8. 8. Goal: Low-Latency for Dynamic Content By Serving Data from Ubiquitous Web Caches Low Latency Less Processing
  9. 9. Idea: use HTTP Caching for dynamic data (e.g. queries) Our Approach Caching Dynamic Data with Bloom filters How to keep the browser cache up-to- date? How to automatically cache complex dynamic data in a CDN? When is data cacheable and for how long approximately?
  10. 10. In a nutshell Problem: changes cause stale data
  11. 11. Stale Data In a nutshell Problem: changes cause stale data
  12. 12. In a nutshell Solution: Proactively Revalidate Data Cache Sketch (Bloom filter) updateIs still fresh? 1 0 11 0 0 10 1 1
  13. 13. Innovation Solution: Proactively Revalidate Data F. Gessert, F. Bücklers, und N. Ritter, „ORESTES: a Scalable Database-as-a-Service Architecture for Low Latency“, in CloudDB 2014, 2014. F. Gessert und F. Bücklers, „ORESTES: ein System für horizontal skalierbaren Zugriff auf Cloud-Datenbanken“, in Informatiktage 2013, 2013. F. Gessert, S. Friedrich, W. Wingerath, M. Schaarschmidt, und N. Ritter, „Towards a Scalable and Unified REST API for Cloud Data Stores“, in 44. Jahrestagung der GI, Bd. 232, S. 723–734. F. Gessert, M. Schaarschmidt, W. Wingerath, S. Friedrich, und N. Ritter, „The Cache Sketch: Revisiting Expiration-based Caching in the Age of Cloud Data Management“, in BTW 2015. F. Gessert und F. Bücklers, Performanz- und Reaktivitätssteigerung von OODBMS vermittels der Web- Caching-Hierarchie. Bachelorarbeit, 2010. F. Gessert und F. Bücklers, Kohärentes Web-Caching von Datenbankobjekten im Cloud Computing. Masterarbeit 2012. W. Wingerath, S. Friedrich, und F. Gessert, „Who Watches the Watchmen? On the Lack of Validation in NoSQL Benchmarking“, in BTW 2015. M. Schaarschmidt, F. Gessert, und N. Ritter, „Towards Automated Polyglot Persistence“, in BTW 2015. S. Friedrich, W. Wingerath, F. Gessert, und N. Ritter, „NoSQL OLTP Benchmarking: A Survey“, in 44. Jahrestagung der Gesellschaft für Informatik, 2014, Bd. 232, S. 693–704. F. Gessert, „Skalierbare NoSQL- und Cloud-Datenbanken in Forschung und Praxis“, BTW 2015
  14. 14.  Bit array of length m and k independent hash functions  insert(obj): add to set  contains(obj): might give a false positive What is a Bloom filter? Compact Probabilistic Sets https://github.com/Baqend/ Orestes-Bloomfilter 1 m 1 1 0 0 1 0 1 0 1 1 Insert y h1h2 h3 y Query x 1 m 1 1 0 0 1 0 1 0 1 1 h1h2 h3 =1? n y contained
  15. 15. 1 4 020 Browser Cache CDN Bloom filters for Caching End-to-End Example
  16. 16. 1 4 020 Browser Cache CDN Bloom filters for Caching End-to-End Example Gets Time-to-Live Estimation by the server
  17. 17. 1 4 020 Browser Cache CDN Bloom filters for Caching End-to-End Example
  18. 18. 1 4 020 Browser Cache CDN Bloom filters for Caching End-to-End Example
  19. 19. 1 4 020 purge(obj) hashB(oid)hashA(oid) 3 Browser Cache CDN 1 Bloom filters for Caching End-to-End Example
  20. 20. 1 4 020 31 1 110 Flat(Counting Bloomfilter) Browser Cache CDN 1 Bloom filters for Caching End-to-End Example
  21. 21. 1 4 020 31 1 110 hashB(oid)hashA(oid) Browser Cache CDN 1 Bloom filters for Caching End-to-End Example
  22. 22. 1 4 020 31 1 110 hashB(oid)hashA(oid) Browser Cache CDN 1 Bloom filters for Caching End-to-End Example
  23. 23. 1 4 020 hashB(oid)hashA(oid) 1 1 110 Browser Cache CDN Bloom filters for Caching End-to-End Example
  24. 24. 1 4 020 hashB(oid)hashA(oid) 1 1 110 Browser Cache CDN Bloom filters for Caching End-to-End Example 𝑓 ≈ 1 − 𝑒− 𝑘𝑛 𝑚 𝑘 𝑘 = ln 2 ⋅ ( 𝑛 𝑚 ) False-Positive Rate: Hash- Functions: With 20.000 distinct updates and 5% error rate: 11 Kbyte Consistency Guarantees: Δ-Atomicity, Read-Your-Writes, Monotonic Reads, Monotonic Writes, Causal Consistency
  25. 25. Show me some Code! End-to-End Example <script src="//baqend.global.ssl.fastly.net/js- sdk/latest/baqend.min.js"></script> Loads the JS SDK including the Bloom filter logic DB.connect('my-app'); Connects to the backend & loads the Bloom filter DB.News.load('2dsfhj3902h3c').then(myCB); DB.Todo.find() .notEqual('done', true) .resultList(myCB); Load & query data using the Bloom filter + Browser Cache
  26. 26. Show me some Code! End-to-End Example <script src="//baqend.global.ssl.fastly.net/js- sdk/latest/baqend.min.js"></script> Loads the JS SDK including the Bloom filter logic DB.connect('my-app'); Connects to the backend & loads the Bloom filter DB.News.load('2dsfhj3902h3c').then(myCB); DB.Todo.find() .notEqual('done', true) .resultList(myCB); Load & query data using the Bloom filter + Browser Cache Try this: www.baqend.com#tutorial
  27. 27. Ziel mit InnoRampUpOur Mission at Baqend: „Kick load times in the ass using Bloom filters“ www.baqend.com @Baqendcom
  • sunggonSong

    Sep. 7, 2020

Lightning Talk from HH.JS June 15/2016.

Views

Total views

6,345

On Slideshare

0

From embeds

0

Number of embeds

3,148

Actions

Downloads

87

Shares

0

Comments

0

Likes

1

×