Settings

Theme

Bloom – Super fast and highly configurable cache for REST APIs

github.com

64 points by andersonrkton 7 years ago · 8 comments

Reader

smudgymcscmudge 7 years ago

I read pretty far into the readme before I realized this doesn't somehow use bloom filters.

roadbeats 7 years ago

How does it compare to Varnish ?

  • njharman 7 years ago

    Vastly simpler, I understand what Bloom is doing after 10min of reading. I had hard time even understanding all of Varnish's scope in same time.

    Written in RUST. Uses Redis. Uses custom headers instead of Cache-Control Seems more flexible cache invalidation, but maybe varnish can do this after understanding all of VCL/Varnish.

    Seems written for an API developer not wanting to write own/reinvent cache layer for their REST API. vs written for a sysadmin who is building a system that is larger/more generic, less tied to one specific app, and who would reach for Varnish being old, reliable and having every feature ever thought of.

    • nathan-io 7 years ago

      > an API developer not wanting to write own/reinvent cache layer for their REST API

      For Laravel projects at least, a package like spatie/laravel-responsecache makes it super easy to handle caching for GET API routes. I'm sure there are similar packers for other frameworks often used in API development.

      I really like Bloom, I'd just rather handle it at the application layer, where I can get the finest level of customization (assuming there's a suitable package to abstract the most tedious work away).

      Seems you could keep the associated code to a minimum, and easily maintainable, by using model events to trigger cache updates.

      Personally, I'd rather have a little more code than a new dependency (and the resources the Bloom takes from each API worker it's installed on). But in situations where it's non-trivial or inadvisable to do it at the application layer, it seems Bloom could be quite useful.

nodesocket 7 years ago

Curious, if you already are running NGINX in front, why not just use proxy_cache?

jmartrican 7 years ago

Reminds me of https://varnish-cache.org/

openbasic 7 years ago

What's the difference between this and varnish or nginx acting like a reverse proxy?

  • nathan-io 7 years ago

    Found this at https://crates.io/crates/bloom-server:

    > A simpler caching approach could have been to enable caching at the Load Balancer level for HTTP read methods (GET, HEAD, OPTIONS). Although simple as a solution, it would not work with a REST API. REST API serve dynamic content by nature, that rely heavily on Authorization headers. Also, any cache needs to be purged at some point, if the content in cache becomes stale due to data updates in some database.

    > NGINX Lua scripts could do that job just fine, you say! Well, I firmly believe Load Balancers should be simple, and be based on configuration only, without scripting. As Load Balancers are the entry point to all your HTTP / WebSocket services, you'd want to avoid frequent deployments and custom code there, and handoff that caching complexity to a dedicated middleware component.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection