A summary of data about the Ruby ecosystem.

https://github.com/petergoldstein/dalli

High performance memcached client for Ruby
https://github.com/petergoldstein/dalli

Keywords from Contributors

activerecord activejob mvc rubygems rack rspec background-jobs sidekiq crash-reporting sinatra

Last synced: about 14 hours ago
JSON representation

Repository metadata

High performance memcached client for Ruby

README.md

Dalli Tests

Dalli is a high performance pure Ruby client for accessing memcached servers.

Dalli supports:

  • Simple and complex memcached configurations
  • Failover between memcached instances
  • Fine-grained control of data serialization and compression
  • Thread-safe operation (either through use of a connection pool, or by using the Dalli client in threadsafe mode)
  • SSL/TLS connections to memcached
  • OpenTelemetry distributed tracing (automatic when SDK is present)

The name is a variant of Salvador Dali for his famous painting The Persistence of Memory.

Requirements

  • Ruby 3.3 or later (JRuby also supported)
  • memcached 1.6 or later

Configuration Options

Namespace

Use namespaces to partition your cache and avoid key collisions between different applications or environments:

# All keys will be prefixed with "myapp:"
Dalli::Client.new('localhost:11211', namespace: 'myapp')

# Dynamic namespace using a Proc (evaluated on each operation)
Dalli::Client.new('localhost:11211', namespace: -> { "tenant:#{Thread.current[:tenant_id]}" })

Namespace Separator

By default, the namespace and key are joined with a colon (:). You can customize this with the namespace_separator option:

# Keys will be prefixed with "myapp/" instead of "myapp:"
Dalli::Client.new('localhost:11211', namespace: 'myapp', namespace_separator: '/')

The separator must be a single non-alphanumeric character. Valid examples: :, /, |, ., -, _, #

Security Note

By default, Dalli uses Ruby's Marshal for serialization. Deserializing untrusted data with Marshal can lead to remote code execution. If you cache user-controlled data, consider using a safer serializer:

Dalli::Client.new('localhost:11211', serializer: JSON)

See the 5.0-Upgrade.md guide for upgrade information.

OpenTelemetry Tracing

Dalli automatically instruments operations with OpenTelemetry when the SDK is present. No configuration is required - just add the OpenTelemetry gems to your application:

# Gemfile
gem 'opentelemetry-sdk'
gem 'opentelemetry-exporter-otlp' # or your preferred exporter

When OpenTelemetry is loaded, Dalli creates spans for:

  • Single key operations: get, set, delete, add, replace, incr, decr, etc.
  • Multi-key operations: get_multi, set_multi, delete_multi
  • Advanced operations: get_with_metadata, fetch_with_lock

Span Attributes

All spans include:

  • db.system: memcached
  • db.operation: The operation name (e.g., get, set_multi)

Single-key operations also include:

  • server.address: The memcached server that handled the request (e.g., localhost:11211)

Multi-key operations include cache efficiency metrics:

  • db.memcached.key_count: Number of keys in the request
  • db.memcached.hit_count: Number of keys found (for get_multi)
  • db.memcached.miss_count: Number of keys not found (for get_multi)

Error Handling

Exceptions are automatically recorded on spans with error status. When an operation fails:

  1. The exception is recorded on the span via span.record_exception(e)
  2. The span status is set to error with the exception message
  3. The exception is re-raised to the caller

Disabling Instrumentation

To disable instrumentation at runtime (e.g., in tests or specific environments):

Dalli::Instrumentation.disable!

You can also assign a custom tracer directly:

Dalli::Instrumentation.tracer = my_custom_tracer

Zero Overhead

When OpenTelemetry is not present, there is zero overhead - the tracing code checks once at startup and bypasses all instrumentation logic entirely when the SDK is not loaded.

Persistence of Memory

Documentation and Information

  • User Documentation - The documentation is maintained in the repository's wiki.
  • Announcements - Announcements of interest to the Dalli community will be posted here.
  • Bug Reports - If you discover a problem with Dalli, please submit a bug report in the tracker.
  • Forum - If you have questions about Dalli, please post them here.
  • Client API - Ruby documentation for the Dalli::Client API

Development

After checking out the repo, run bin/setup to install dependencies. You can run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

Contributing

Please see CONTRIBUTING.md for guidelines on how to contribute, including our policy on AI-authored contributions.

Appreciation

Dalli would not exist in its current form without the contributions of many people. But special thanks go to several individuals and organizations:

  • Mike Perham - for originally authoring the Dalli project and serving as maintainer and primary contributor for many years
  • Eric Wong - for help using his kgio library.
  • Brian Mitchell - for his remix-stash project which was helpful when implementing and testing the binary protocol support.
  • CouchBase - for their sponsorship of the original development

Authors

Copyright

Copyright (c) Mike Perham, Peter M. Goldstein. See LICENSE for details.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: about 15 hours ago

Total Commits: 1,084
Total Committers: 188
Avg Commits per committer: 5.766
Development Distribution Score (DDS): 0.664

Commits in past year: 115
Committers in past year: 12
Avg Commits per committer in past year: 9.583
Development Distribution Score (DDS) in past year: 0.33

Name Email Commits
Mike Perham m****m@g****m 364
Peter Goldstein p****n@g****m 275
Corin Langosch i****o@n****m 26
Aman Gupta a****n@t****t 26
Brian Lopez s****z@g****m 21
Jean Boussier j****r@g****m 18
dfens m****p@g****m 17
Dan Mayer d****r@s****m 8
Matt Larraz m****z 7
Graham Cooper g****r@s****m 7
Arthur Neves a****n@g****m 6
Jack Chen (chendo) me@c****o 6
Michael Grosser m****l@g****t 6
Steve Richert s****t@g****m 6
dependabot[bot] 4****] 6
Alexander Kahn a****n@g****m 5
Jean byroot Boussier j****b@s****m 5
Joeri Samson j****i@x****m 5
Sebastian Staudt k****r@g****m 5
Brandon Dunne b****e@h****m 5
Rafael Mendonça França r****a@p****r 5
tipair t****s@d****m 5
Olle Jonsson o****n@a****m 5
Naseem Hakim n****m@a****m 4
Jingkai He j****e@g****m 4
Claude n****y@a****m 4
pitr p****n@g****m 4
Donald Plummer d****r@g****m 4
Josh Lewis j****s@g****m 4
Nate Berkopec n****c@g****m 4
and 158 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 7 days ago

Total issues: 52
Total pull requests: 239
Average time to close issues: 6 months
Average time to close pull requests: 22 days
Total issue authors: 42
Total pull request authors: 39
Average comments per issue: 3.23
Average comments per pull request: 1.12
Merged pull request: 178
Bot issues: 0
Bot pull requests: 10

Past year issues: 4
Past year pull requests: 63
Past year average time to close issues: 1 day
Past year average time to close pull requests: 6 days
Past year issue authors: 4
Past year pull request authors: 11
Past year average comments per issue: 1.0
Past year average comments per pull request: 0.89
Past year merged pull request: 41
Past year bot issues: 0
Past year bot pull requests: 7

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/petergoldstein/dalli

Top Issue Authors

  • petergoldstein (7)
  • mecampbellsoup (3)
  • Neustradamus (2)
  • nickamorim (2)
  • leehsueh (1)
  • cornu-ammonis (1)
  • jshoung (1)
  • matthewzinke (1)
  • Bennet-Sunder (1)
  • justinschier (1)
  • paul-mesnilgrente (1)
  • larouxn (1)
  • xspaniki (1)
  • diegonogueira (1)
  • xhzeem (1)

Top Pull Request Authors

  • petergoldstein (110)
  • byroot (20)
  • grcooper (14)
  • danmayer (10)
  • dependabot[bot] (10)
  • olleolleolle (10)
  • casperisfine (6)
  • sambostock (5)
  • mlarraz (5)
  • eugeneius (4)
  • y9v (4)
  • PatrickTulskie (4)
  • m-nakamura145 (3)
  • naveg (2)
  • Earlopain (2)

Top Issue Labels

Top Pull Request Labels

  • dependencies (10)
  • github_actions (7)

Package metadata

gem.coop: dalli

High performance memcached client for Ruby

  • Homepage: https://github.com/petergoldstein/dalli
  • Documentation: http://www.rubydoc.info/gems/dalli/
  • Licenses: MIT
  • Latest release: 5.0.5 (published 21 days ago)
  • Last Synced: 2026-06-14T20:33:37.553Z (1 day ago)
  • Versions: 93
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 125,089,161 Total
  • Docker Downloads: 460,961,459
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.113%
    • Downloads: 0.212%
    • Docker downloads count: 0.239%
  • Maintainers (2)
ubuntu-22.04: ruby-dalli

  • Homepage: https://github.com/petergoldstein/dalli
  • Licenses: mit
  • Latest release: 3.0.6-1 (published 4 months ago)
  • Last Synced: 2026-03-13T13:38:05.567Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.116%
    • Forks count: 0.21%
    • Stargazers count: 0.254%
rubygems.org: dalli

High performance memcached client for Ruby

  • Homepage: https://github.com/petergoldstein/dalli
  • Documentation: http://www.rubydoc.info/gems/dalli/
  • Licenses: MIT
  • Latest release: 5.0.5 (published 21 days ago)
  • Last Synced: 2026-06-15T13:15:47.323Z (about 19 hours ago)
  • Versions: 93
  • Dependent Packages: 213
  • Dependent Repositories: 11,488
  • Downloads: 125,115,580 Total
  • Docker Downloads: 460,961,459
  • Rankings:
    • Dependent packages count: 0.181%
    • Downloads: 0.187%
    • Dependent repos count: 0.318%
    • Docker downloads count: 0.448%
    • Average: 0.509%
    • Stargazers count: 0.644%
    • Forks count: 1.277%
  • Maintainers (2)
  • Advisories:
proxy.golang.org: github.com/petergoldstein/dalli

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/petergoldstein/dalli#section-documentation
  • Licenses: mit
  • Latest release: v5.0.5+incompatible (published 21 days ago)
  • Last Synced: 2026-06-13T17:02:52.039Z (3 days ago)
  • Versions: 71
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 1.244%
    • Forks count: 1.389%
    • Average: 5.753%
    • Dependent packages count: 9.576%
    • Dependent repos count: 10.802%
ubuntu-24.04: ruby-dalli

  • Homepage: https://github.com/petergoldstein/dalli
  • Licenses:
  • Latest release: 3.0.6-2 (published 4 months ago)
  • Last Synced: 2026-03-06T15:58:14.366Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-20.04: ruby-dalli

  • Homepage: https://github.com/petergoldstein/dalli
  • Licenses: mit
  • Latest release: 2.7.9-2 (published 4 months ago)
  • Last Synced: 2026-03-13T20:20:35.243Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.10: ruby-dalli

  • Homepage: https://github.com/petergoldstein/dalli
  • Licenses:
  • Latest release: 3.0.6-1.1 (published 4 months ago)
  • Last Synced: 2026-03-14T02:17:00.399Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-11: ruby-dalli

  • Homepage: https://github.com/petergoldstein/dalli
  • Documentation: https://packages.debian.org/bullseye/ruby-dalli
  • Licenses:
  • Latest release: 2.7.11-1 (published 4 months ago)
  • Last Synced: 2026-03-14T06:21:55.078Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.04: ruby-dalli

  • Homepage: https://github.com/petergoldstein/dalli
  • Licenses:
  • Latest release: 3.0.6-1.1 (published 4 months ago)
  • Last Synced: 2026-03-11T14:11:24.535Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
guix: ruby-dalli

High performance memcached client for Ruby

  • Homepage: https://github.com/petergoldstein/dalli
  • Documentation: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/ruby-xyz.scm#n5831
  • Licenses: expat
  • Latest release: 3.2.4 (published 4 months ago)
  • Last Synced: 2026-04-27T16:17:36.682Z (about 2 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
gentoo-portage: dev-ruby/dalli

A high performance pure Ruby client for accessing memcached servers

  • Homepage: https://github.com/petergoldstein/dalli
  • Documentation: https://packages.gentoo.org/packages/dev-ruby/dalli
  • Licenses: MIT
  • Latest release: 4.0.0 (published about 2 months ago)
  • Last Synced: 2026-05-27T02:44:33.713Z (20 days ago)
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.10: ruby-dalli

  • Homepage: https://github.com/petergoldstein/dalli
  • Licenses:
  • Latest release: 3.0.6-2 (published 4 months ago)
  • Last Synced: 2026-03-09T17:04:01.809Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-13: ruby-dalli

  • Homepage: https://github.com/petergoldstein/dalli
  • Documentation: https://packages.debian.org/trixie/ruby-dalli
  • Licenses: mit
  • Latest release: 3.2.8-2 (published 4 months ago)
  • Last Synced: 2026-03-14T15:02:14.786Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-12: ruby-dalli

  • Homepage: https://github.com/petergoldstein/dalli
  • Documentation: https://packages.debian.org/bookworm/ruby-dalli
  • Licenses:
  • Latest release: 3.0.6-1.1 (published 4 months ago)
  • Last Synced: 2026-03-13T03:28:42.041Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%

Dependencies

.github/workflows/codeql-analysis.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/rubocop.yml actions
  • actions/checkout v3 composite
  • ruby/setup-ruby v1 composite
.github/workflows/tests.yml actions
  • actions/checkout v3 composite
  • ruby/setup-ruby v1 composite
Gemfile rubygems
  • ruby-prof >= 0 development
dalli.gemspec rubygems
  • connection_pool >= 0 development
  • minitest ~> 5 development
  • rack ~> 2.0, >= 2.2.0 development
  • rake ~> 13.0 development
  • rubocop >= 0 development
  • rubocop-minitest >= 0 development
  • rubocop-performance >= 0 development
  • rubocop-rake >= 0 development
  • simplecov >= 0 development
.github/workflows/benchmarks.yml actions
  • actions/checkout v4 composite
  • ruby/setup-ruby v1 composite
.devcontainer/Dockerfile docker
  • ruby 3.4-bullseye build
.github/workflows/profile.yml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • ruby/setup-ruby v1 composite
.devcontainer/docker-compose.yml docker

Score: 34.16380669698687