minisketch VS Caffeine

Compare minisketch vs Caffeine and see what are their differences.

minisketch

Minisketch: an optimized library for BCH-based set reconciliation (by sipa)

Caffeine

A high performance caching library for Java (by ben-manes)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
minisketch Caffeine
10 43
301 15,186
- -
0.0 9.7
3 days ago 4 days ago
C++ Java
MIT License Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

minisketch

Posts with mentions or reviews of minisketch. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-20.
  • Invertible Bloom Lookup Tables with Less Randomness and Memory
    1 project | news.ycombinator.com | 13 Jul 2023
    Anyone interested in IBLT with low failure probablity should also be aware of pinsketch and, particularly, our implementation of it: minisketch ( https://github.com/sipa/minisketch/ ).

    Our implementation communicates a difference of N b-bit entries with exactly N*b bits with 100% success. The cost for this communications efficiency and reliability is that the decoder takes CPU time quadratic in N, instead of IBLT's linear decoder. However, when N is usually small, if the implementation is fast this can be fine -- especially since you wouldn't normally want to use set recon unless you were communications limited.

    Pinsketches and iblt can also be combined-- one can use pinsketches as the cells of an iblt and one can also use a small pinsketch to improve the failure rate of an iblt (since when a correctly sized IBLT fails, it's usually just due to a single undecodable cycle).

  • Minisketch: an optimized library for BCH-based set reconciliation
    1 project | news.ycombinator.com | 6 Mar 2023
  • Peer-to-Peer Encrypted Messaging
    11 projects | news.ycombinator.com | 20 Nov 2022
    Since the protocol appears to use adhoc synchronization, the authors might be interested in https://github.com/sipa/minisketch/ which is a library that implements a data structure (pinsketch) that allows two parties to synchronize their sets of m b-bit elements which differ by c entries using only b*c bits. A naive protocol would use m*b bits instead, which is potentially much larger.

    I'd guess that under normal usage the message densities probably don't justify such efficient means-- we developed this library for use in bitcoin targeting rates on the order of a dozen new messages per second and where every participant has many peers with potentially differing sets--, but it's still probably worth being aware of. The pinsketch is always equal or more efficient than a naive approach, but may not be worth the complexity.

    The somewhat better known IBLT data structure has constant overheads that make it less efficient than even naive synchronization until the set differences are fairly large (particular when the element hashes are small); so some applications that evaluated and eschewed IBLT might find pinsketch applicable.

  • Ask HN: What are some 'cool' but obscure data structures you know about?
    54 projects | news.ycombinator.com | 21 Jul 2022
    I love the set reconciliation structures like the IBLT (Iterative Bloom Lookup Table) and BCH set digests like minisketch.

    https://github.com/sipa/minisketch

    Lets say you have a set of a billion items. Someone else has mostly the same set but they differ by 10 items. These let you exchange messages that would fit in one UDP packet to reconcile the sets.

  • Here is how Ethereum COULD scale without increasing centralisation and without depending on layer two's.
    2 projects | /r/CryptoTechnology | 27 Jan 2022
    Sipa is working on a better version of that for a while. The technical term is a "set reconciliation protocol", but Bitcoin Core been doing a more basic version of this for a while. Note that the "BCH" there isn't the same as Bcash
  • ish: Sketches for Zig
    3 projects | /r/Zig | 18 Dec 2021
    I'd also have to say that Zig is a pretty neat library for this. In order to implement PBS I needed the MiniSketch-library (written in C/C++) and I'll have to say that integrating with it has been a breeze. Some fiddling in build.zig so that I can avoid Makefile, and after that everything has worked amazingly.
  • The Pinecone Overlay Network
    2 projects | news.ycombinator.com | 7 May 2021
    Networks that need to constrain themselves to limited typologies to avoid traffic magnification do so at the expense of robustness, especially against active attackers that grind their identifiers to gain privileged positions.

    Maybe this is a space where efficient reconciliation ( https://github.com/sipa/minisketch/ ) could help-- certainly if the goal were to flood messages to participants reconciliation can give almost optimal communication without compromising robustness.

  • Is it any easier to find A, B such that sha256(A) ^ sha256(B) = sha256(C)?
    1 project | /r/crypto | 19 Jan 2021

Caffeine

Posts with mentions or reviews of Caffeine. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-23.
  • Otter, Fastest Go in-memory cache based on S3-FIFO algorithm
    16 projects | news.ycombinator.com | 23 Dec 2023
    /u/someplaceguy,

    Those LIRS traces, along with many others, available at this page [1]. I did a cursory review using their traces using Caffeine's and the author's simulators to avoid bias or a mistaken implementation. In their target workloads Caffeine was on par or better [2]. I have not seen anything novel in this or their previous works and find their claims to be easily disproven, so I have not implement this policy in Caffeine simulator yet.

    [1]: https://github.com/ben-manes/caffeine/wiki/Simulator

    [2]: https://github.com/1a1a11a/libCacheSim/discussions/20

  • Google/guava: Google core libraries for Java
    3 projects | news.ycombinator.com | 8 Nov 2023
    That, and also when caffeine came out it replaced one of the major uses (caching) of guava.

    https://github.com/ben-manes/caffeine

  • GC, hands off my data!
    6 projects | dev.to | 27 Oct 2023
    I decided to start with an overview of what open-source options are currently available. When it comes to the implementation of the on-heap cache mechanism, the options are numerous – there is well known: guava, ehcache, caffeine and many other solutions. However, when I began researching cache mechanisms offering the possibility of storing data outside GC control, I found out that there are very few solutions left. Out of the popular ones, only Terracotta is supported. It seems that this is a very niche solution and we do not have many options to choose from. In terms of less-known projects, I came across Chronicle-Map, MapDB and OHC. I chose the last one because it was created as part of the Cassandra project, which I had some experience with and was curious about how this component worked:
  • Spring Cache with Caffeine
    2 projects | dev.to | 22 Oct 2023
    Visit the official Caffeine git project and documentation here for more information if you are interested in the subject.
  • Helidon Níma is the first Java microservices framework based on virtual threads
    4 projects | news.ycombinator.com | 19 Aug 2023
    not to distract from your valid points but, when used properly, Caffeine + Reactor can work together really nicely [1].

    [1] https://github.com/ben-manes/caffeine/tree/master/examples/c...

  • FIFO-Reinsertion is better than LRU [pdf]
    3 projects | news.ycombinator.com | 22 Jun 2023
    Yes, I think that is my main concern in that often research papers do not disclose the weaknesses of their approaches and the opposing tradeoffs. There is no silver bullet.

    The stress workload that I use is to chain corda-large [1], 5x loop [2], corda-large at a cache size of 512 entries and 6M requests. This shifts from a strongly LRU-biased pattern to an MRU one, and then back again. My solution to this was to use hill climbing by sampling the hit rate to adaptively size of the admission window (aka your FIFO) to reconfigure the cache region sizes. You already have similar code in your CACHEUS implementation which built on that idea to apply it to a multi-agent policy.

    Caffeine adjusts the frequency comparison for admission slightly to allow ~1% of losing warm candidates to enter the main region. This is to protect against hash flooding attack (HashDoS) [3]. That isn't intended to improve or correct the policy's decision making so should be unrelated to your observations, but an important change for real-world usage.

    I believe LIRS2 [4] adaptively sizes their LIR region, but I do not recall the details as a complex algorithm. It did very well across different workloads when I tried it out and the authors were able to make a few performance fixes based on my feedback. Unfortunately I find LIRS algorithms to be too difficult to maintain for an industry setting because while excellent, the implementation logic is not intuitive which makes it frustrating to debug.

    [1] https://github.com/ben-manes/caffeine/blob/master/simulator/...

  • Guava 32.0 (released today) and the @Beta annotation
    5 projects | /r/java | 30 May 2023
    A lot of Guava's most popular libraries graduated to the JDK. Also Caffeine is the evolution of our c.g.common.cache library. So you need Guava less than you used to. Hooray!
  • Monitoring Guava Cache Statistics
    1 project | /r/java | 30 May 2023
  • Apache Baremaps: online maps toolkit
    6 projects | news.ycombinator.com | 28 May 2023
    Unfortunately, I don't gather statistics on the demonstration server. I believe that the in-memory caffeine cache (https://github.com/ben-manes/caffeine) saved me.
  • Similar probabilistic algorithms like Hyperloglog?
    1 project | /r/compsci | 19 Mar 2023
    Caffeine is a Java cache that uses a 4-bit count-min sketch to estimate the popularity of an entry over a sample period. This is used by an admission filter (TinyLFU) to determine whether the new arrival is more valuable than the LRU victim. This is combined with hill climbing to optimize how much space is allocated for frequency vs recency. That results in an adaptive eviction policy that is space and time efficient, and achieves very high hit rates.

What are some alternatives?

When comparing minisketch and Caffeine you can also consider the following projects:

wormhole-william-mobile - End-to-end encrypted file transfer for Android and iOS. A Magic Wormhole Mobile client.

Ehcache - Ehcache 3.x line

ctrie-java - Java implementation of a concurrent trie

Hazelcast - Hazelcast is a unified real-time data platform combining stream processing with a fast data store, allowing customers to act instantly on data-in-motion for real-time insights.

tries-T9-Prediction - Its artificial intelligence algorithm of T9 mobile

cache2k - Lightweight, high performance Java caching

t-digest - A new data structure for accurate on-line accumulation of rank-based statistics such as quantiles and trimmed means

Apache Geode - Apache Geode

sdsl-lite - Succinct Data Structure Library 2.0

Guava - Google core libraries for Java

ann-benchmarks - Benchmarks of approximate nearest neighbor libraries in Python

scaffeine - Thin Scala wrapper for Caffeine (https://github.com/ben-manes/caffeine)