# \#ristretto

**URL:** https://discuss.dgraph.io/tag/ristretto/104.md

[Latest](https://discuss.dgraph.io/latest.md) · [Categories](https://discuss.dgraph.io/categories.md) · [Tags](https://discuss.dgraph.io/tags.md)

---

## [Question - Keys added and Keys evicted graphs are similar?](https://discuss.dgraph.io/t/question-keys-added-and-keys-evicted-graphs-are-similar/8426)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 9\
**Last updated:** [January 17, 2025, 1:24pm UTC](https://discuss.dgraph.io/t/question-keys-added-and-keys-evicted-graphs-are-similar/8426 "2025-01-17T13:24:24Z")

</div>

Moved from GitHub ristretto/165 Posted by varun06: Hey Folks, I am testing Ristretto in QA environment. I am still trying to understand few things. Once thing that I noticed, line for Keys Added and Keys Evicted are s…

---

## [Attend hack.summit() for free](https://discuss.dgraph.io/t/attend-hack-summit-for-free/18356)

<div class="topic-metadata">

**Author:** [@akon](https://discuss.dgraph.io/u/akon)\
**Replies:** 0\
**Last updated:** [March 3, 2023, 9:00pm UTC](https://discuss.dgraph.io/t/attend-hack-summit-for-free/18356 "2023-03-03T21:00:13Z")

</div>

Hi DGraph Community, You can attend hack.summit() for free. Come join us at hack.summit() — a virtual conference where you can learn about blockchain concepts. You can attend from anywhere, and the event is happening M…

---

## [How does Ristretto guarantee or verify its correctness?](https://discuss.dgraph.io/t/how-does-ristretto-guarantee-or-verify-its-correctness/15828)

<div class="topic-metadata">

**Author:** [@youde](https://discuss.dgraph.io/u/youde)\
**Replies:** 2\
**Last updated:** [October 19, 2021, 7:40pm UTC](https://discuss.dgraph.io/t/how-does-ristretto-guarantee-or-verify-its-correctness/15828 "2021-10-19T19:40:21Z")

</div>

According to the Ristretto README: Ristretto is a fast, concurrent cache library built with a focus on performance and correctness. I have been looking into the project but I could not find any formal specification. …

---

## [Error: mremap size mismatch on ARM64](https://discuss.dgraph.io/t/error-mremap-size-mismatch-on-arm64/15333)

<div class="topic-metadata">

**Author:** [@yarysh](https://discuss.dgraph.io/u/yarysh)\
**Replies:** 6\
**Last updated:** [September 18, 2021, 3:38pm UTC](https://discuss.dgraph.io/t/error-mremap-size-mismatch-on-arm64/15333 "2021-09-18T15:38:05Z")

</div>

What version of Go are you using (go version)? go version go1.16.7 linux/arm64 What operating system are you using? Ubuntu 20.04.2 LTS Does this issue reproduce with the latest master? Yes. Steps to Reproduce the issu…

---

## [Bug: first Set() overwrites later Set "updates" due to buffer propagation delay](https://discuss.dgraph.io/t/bug-first-set-overwrites-later-set-updates-due-to-buffer-propagation-delay/15515)

<div class="topic-metadata">

**Author:** [@kakysha](https://discuss.dgraph.io/u/kakysha)\
**Replies:** 0\
**Last updated:** [September 8, 2021, 1:13pm UTC](https://discuss.dgraph.io/t/bug-first-set-overwrites-later-set-updates-due-to-buffer-propagation-delay/15515 "2021-09-08T13:13:01Z")

</div>

So I’m adding many keys pretty fast into the cache, every key has the following process: Set(key, original\_value) - first set for the key. As I get it, the value gets into set buffer and not added immediately into the…

---

## [Proposal: add metrics KeysNumber](https://discuss.dgraph.io/t/proposal-add-metrics-keysnumber/8421)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 3\
**Last updated:** [August 10, 2021, 2:53pm UTC](https://discuss.dgraph.io/t/proposal-add-metrics-keysnumber/8421 "2021-08-10T14:53:20Z")

</div>

Moved from GitHub ristretto/135 Posted by choleraehyq: Here I want to get the key numbers current cache contains. Seems it’s easy to maintain.

---

## [Allow external storage implementations](https://discuss.dgraph.io/t/allow-external-storage-implementations/8715)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 4\
**Last updated:** [May 4, 2021, 6:18am UTC](https://discuss.dgraph.io/t/allow-external-storage-implementations/8715 "2021-05-04T06:18:58Z")

</div>

Moved from GitHub ristretto/151 Posted by MarcErdmann: It would be great to use Ristretto with external storage backends. If Ristretto would export all necessary interfaces one can implement adapters. With e.g. in-memo…

---

## [Does ristretto fires event when ttl expires](https://discuss.dgraph.io/t/does-ristretto-fires-event-when-ttl-expires/12499)

<div class="topic-metadata">

**Author:** [@smartaquarius10](https://discuss.dgraph.io/u/smartaquarius10)\
**Replies:** 4\
**Last updated:** [February 2, 2021, 7:09pm UTC](https://discuss.dgraph.io/t/does-ristretto-fires-event-when-ttl-expires/12499 "2021-02-02T19:09:43Z")

</div>

Team, I’m making an app where I have to save data in db and ristretto as well. Does ristretto fires any event on ttl expiration of an object. It would be easier to manage the db in parallel. Especially in oauth servers…

---

## [Why is ristretto using so much memory?](https://discuss.dgraph.io/t/why-is-ristretto-using-so-much-memory/8418)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 17\
**Last updated:** [October 12, 2020, 2:20pm UTC](https://discuss.dgraph.io/t/why-is-ristretto-using-so-much-memory/8418 "2020-10-12T14:20:25Z")

</div>

Moved from GitHub ristretto/115 Posted by caofengl: package main import ( "fmt" "math/rand" "strconv" "github.com/dgraph-io/ristretto" ) const ( maxCnt = 1e7 maxLoop = 1e8 ) func main() { cahchePool, err :=…

---

## [KeyToHash possibly letting key interfaces escape to heap](https://discuss.dgraph.io/t/keytohash-possibly-letting-key-interfaces-escape-to-heap/8711)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 2\
**Last updated:** [September 30, 2020, 11:15pm UTC](https://discuss.dgraph.io/t/keytohash-possibly-letting-key-interfaces-escape-to-heap/8711 "2020-09-30T23:15:58Z")

</div>

Moved from GitHub ristretto/107 Posted by karlmcguire: As brought up in the performance Gopher channel, since we’re using interface{} for keys, this call to keyToHash is probably letting the interface escape to heap. S…

---

## [Question: read-your-writes consistency](https://discuss.dgraph.io/t/question-read-your-writes-consistency/8708)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 6\
**Last updated:** [August 17, 2020, 9:28pm UTC](https://discuss.dgraph.io/t/question-read-your-writes-consistency/8708 "2020-08-17T21:28:01Z")

</div>

Moved from GitHub ristretto/102 Posted by maciej: Hi! Do you have any plans to add operations having read-your-writes consistency at any point in the future? Thanks!

---

## [Cost vs value and limiting memory consumption](https://discuss.dgraph.io/t/cost-vs-value-and-limiting-memory-consumption/9300)

<div class="topic-metadata">

**Author:** [@hkeide](https://discuss.dgraph.io/u/hkeide)\
**Replies:** 2\
**Last updated:** [August 13, 2020, 6:48pm UTC](https://discuss.dgraph.io/t/cost-vs-value-and-limiting-memory-consumption/9300 "2020-08-13T18:48:12Z")

</div>

I have some values I want to cache which are very expensive to generate in terms of processing, and some that are comparatively cheaper but have a bigger size in bytes. As I understand it I can input the cost of generat…

---

## [Set up TeamCity](https://discuss.dgraph.io/t/set-up-teamcity/8709)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 2\
**Last updated:** [August 9, 2020, 10:41pm UTC](https://discuss.dgraph.io/t/set-up-teamcity/8709 "2020-08-09T22:41:15Z")

</div>

Moved from GitHub ristretto/103 Posted by karlmcguire: Migrate away from Github actions and use something else as discussed.

---

## [Using custom KeyToHash in configuration resulting in drop of cache hit ratio](https://discuss.dgraph.io/t/using-custom-keytohash-in-configuration-resulting-in-drop-of-cache-hit-ratio/8374)

<div class="topic-metadata">

**Author:** [@muskan\_sethia](https://discuss.dgraph.io/u/muskan_sethia)\
**Replies:** 12\
**Last updated:** [July 16, 2020, 6:09pm UTC](https://discuss.dgraph.io/t/using-custom-keytohash-in-configuration-resulting-in-drop-of-cache-hit-ratio/8374 "2020-07-16T18:09:32Z")

</div>

Hi, I’m trying to use a custom KeyToHash function in my configuration but it has resulted in a massive drop in cache hit ratio from 90+% to almost 4%. I’ve also updated to the most recent version of ristretto in my app…

---

## [Delete operation performs the store.delete twice](https://discuss.dgraph.io/t/delete-operation-performs-the-store-delete-twice/8427)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 0\
**Last updated:** [June 30, 2020, 7:10am UTC](https://discuss.dgraph.io/t/delete-operation-performs-the-store-delete-twice/8427 "2020-06-30T07:10:32Z")

</div>

Moved from GitHub ristretto/170 Posted by jarifibrahim: When an item is deleted by cache.Del(key), we delete it from the store on the following line https://github.com/dgraph-io/ristretto/blob/a093fe661329ba68a99a9c3a…

---

## [Ristretto should investigate using the new go builtin hash functions](https://discuss.dgraph.io/t/ristretto-should-investigate-using-the-new-go-builtin-hash-functions/8425)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [June 10, 2020, 5:40pm UTC](https://discuss.dgraph.io/t/ristretto-should-investigate-using-the-new-go-builtin-hash-functions/8425 "2020-06-10T17:40:31Z")

</div>

Moved from GitHub ristretto/163 Posted by nes1983: The latest version of Go ships with a maphash package that’s meant for exactly ristretto’s kind of use case: https://golang.org/pkg/hash/maphash/. It’s probably worth …

---

## [There should be a test-only blocking mode](https://discuss.dgraph.io/t/there-should-be-a-test-only-blocking-mode/8424)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 0\
**Last updated:** [June 10, 2020, 5:14pm UTC](https://discuss.dgraph.io/t/there-should-be-a-test-only-blocking-mode/8424 "2020-06-10T17:14:08Z")

</div>

Moved from GitHub ristretto/162 Posted by nes1983: The readme file shows that in order to test ristretto, one must use time.Sleep. As far as I understand, that isn’t good software engineering practice. In fact, it’s co…

---

## [Refresh after write feature request](https://discuss.dgraph.io/t/refresh-after-write-feature-request/8423)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [May 14, 2020, 6:26am UTC](https://discuss.dgraph.io/t/refresh-after-write-feature-request/8423 "2020-05-14T06:26:03Z")

</div>

Moved from GitHub ristretto/159 Posted by sanketpayghan: Caches like guava (java) has functionality to refresh cache values after write and after access by some time duration. Can we have something similar to it in ri…

---

## [Standard lib includes maphash](https://discuss.dgraph.io/t/standard-lib-includes-maphash/8717)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [May 11, 2020, 10:57pm UTC](https://discuss.dgraph.io/t/standard-lib-includes-maphash/8717 "2020-05-11T22:57:33Z")

</div>

Moved from GitHub ristretto/156 Posted by masknu: It seems like golang standard library includes memhash in version 1.14.1. The import path is “hash/maphash”. Didn’t test it yet, perhaps it could replace memhash in t…

---

## [Broken images in the Readme](https://discuss.dgraph.io/t/broken-images-in-the-readme/8716)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [May 5, 2020, 9:16pm UTC](https://discuss.dgraph.io/t/broken-images-in-the-readme/8716 "2020-05-05T21:16:33Z")

</div>

Moved from GitHub ristretto/155 Posted by paskal: Readme has links to images like https://raw.githubusercontent.com/karlmcguire/karlmcguire.com/master/docs/Hit%20Ratios%20-%20Search%20(ARC-S3).svg?sanitize=true which a…

---

## [Feature Request: Transactions](https://discuss.dgraph.io/t/feature-request-transactions/8422)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 2\
**Last updated:** [April 15, 2020, 10:01pm UTC](https://discuss.dgraph.io/t/feature-request-transactions/8422 "2020-04-15T22:01:37Z")

</div>

Moved from GitHub ristretto/152 Posted by MarcErdmann: It would be great if Ristretto can somehow provide transactions.

---

## [NewDefaultCache to encapsulate defaults](https://discuss.dgraph.io/t/newdefaultcache-to-encapsulate-defaults/8714)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 0\
**Last updated:** [March 5, 2020, 6:32pm UTC](https://discuss.dgraph.io/t/newdefaultcache-to-encapsulate-defaults/8714 "2020-03-05T18:32:37Z")

</div>

Moved from GitHub ristretto/146 Posted by WBare: The current NewCache constructor requires the user to hard code ristretto defaults in their code. Specifically, NumCounters is 100 x estimated items. The interface sho…

---

## [Reduce GC overhead by using custom memory allocator](https://discuss.dgraph.io/t/reduce-gc-overhead-by-using-custom-memory-allocator/8703)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 13\
**Last updated:** [February 24, 2020, 8:03am UTC](https://discuss.dgraph.io/t/reduce-gc-overhead-by-using-custom-memory-allocator/8703 "2020-02-24T08:03:05Z")

</div>

Moved from GitHub ristretto/8 Posted by mangalaman93:

---

## [When using \`string\` as keys, there could be hash collisions, and thus \`Get\` could return the wrong data](https://discuss.dgraph.io/t/when-using-string-as-keys-there-could-be-hash-collisions-and-thus-get-could-return-the-wrong-data/8705)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 13\
**Last updated:** [February 21, 2020, 10:30pm UTC](https://discuss.dgraph.io/t/when-using-string-as-keys-there-could-be-hash-collisions-and-thus-get-could-return-the-wrong-data/8705 "2020-02-21T22:30:30Z")

</div>

Moved from GitHub ristretto/30 Posted by cipriancraciun: This is more a “design question” than an actual “issue”, however given its implications I think it is an important question which impacts either the design or th…

---

## [Protect against hash attacks](https://discuss.dgraph.io/t/protect-against-hash-attacks/8420)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 0\
**Last updated:** [January 31, 2020, 12:45am UTC](https://discuss.dgraph.io/t/protect-against-hash-attacks/8420 "2020-01-31T00:45:37Z")

</div>

Moved from GitHub ristretto/131 Posted by martinmr: An attacker can prevent new items from being accepted by the policy by artificially raising the frequency of the victim. Caffeine code: https://github.com/ben-manes/…

---

## [cmSketch not benefitting from four rows](https://discuss.dgraph.io/t/cmsketch-not-benefitting-from-four-rows/8712)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 18\
**Last updated:** [January 26, 2020, 11:56pm UTC](https://discuss.dgraph.io/t/cmsketch-not-benefitting-from-four-rows/8712 "2020-01-26T23:56:04Z")

</div>

Moved from GitHub ristretto/108 Posted by FrankReh: I believe the commit f823dc4a broke the purpose of the cm sketch to have four rows. The bitwise-xor and mask are not creating the mix of indexes expected by the desig…

---

## [Add multidelete support](https://discuss.dgraph.io/t/add-multidelete-support/8419)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 3\
**Last updated:** [December 19, 2019, 7:46pm UTC](https://discuss.dgraph.io/t/add-multidelete-support/8419 "2019-12-19T19:46:23Z")

</div>

Moved from GitHub ristretto/109 Posted by balajijinnah: Support multi delete. Make Del as a vardic function to support delete.

---

## [Add option to serialize cache contents to disk for warm startup](https://discuss.dgraph.io/t/add-option-to-serialize-cache-contents-to-disk-for-warm-startup/8710)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 0\
**Last updated:** [November 16, 2019, 12:33am UTC](https://discuss.dgraph.io/t/add-option-to-serialize-cache-contents-to-disk-for-warm-startup/8710 "2019-11-16T00:33:54Z")

</div>

Moved from GitHub ristretto/105 Posted by karlmcguire: Requested by someone at GoSF meetup.

---

## [Add more cache implementations to benchmarking suite](https://discuss.dgraph.io/t/add-more-cache-implementations-to-benchmarking-suite/8707)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 3\
**Last updated:** [October 1, 2019, 4:40pm UTC](https://discuss.dgraph.io/t/add-more-cache-implementations-to-benchmarking-suite/8707 "2019-10-01T16:40:05Z")

</div>

Moved from GitHub ristretto/83 Posted by karlmcguire: https://github.com/jamiealquiza/bicache https://github.com/muesli/cache2go

---

## [Time aware LFU (windowing, temporary immunity)](https://discuss.dgraph.io/t/time-aware-lfu-windowing-temporary-immunity/8706)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 4\
**Last updated:** [September 20, 2019, 3:23pm UTC](https://discuss.dgraph.io/t/time-aware-lfu-windowing-temporary-immunity/8706 "2019-09-20T15:23:30Z")

</div>

Moved from GitHub ristretto/46 Posted by andersfylling: Would you consider adding a time aware LFU, such that completely new entries can’t have the probability of being evicted right after insertion? Eg. New entries a…

[Next page](https://discuss.dgraph.io/tag/ristretto/104.md?match_all_tags=true&page=1&tags%5B%5D=ristretto)
