[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7874":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":26,"discoverSource":27},7874,"dalli","petergoldstein\u002Fdalli","petergoldstein","High performance memcached client for Ruby","",null,"Ruby",3114,465,49,2,0,30.01,"MIT License",false,"main",true,[],"2026-06-12 02:01:45","Dalli [![Tests](https:\u002F\u002Fgithub.com\u002Fpetergoldstein\u002Fdalli\u002Factions\u002Fworkflows\u002Ftests.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fpetergoldstein\u002Fdalli\u002Factions\u002Fworkflows\u002Ftests.yml)\n=====\n\nDalli is a high performance pure Ruby client for accessing memcached servers.\n\nDalli supports:\n\n* Simple and complex memcached configurations\n* Failover between memcached instances\n* Fine-grained control of data serialization and compression\n* Thread-safe operation (either through use of a connection pool, or by using the Dalli client in threadsafe mode)\n* SSL\u002FTLS connections to memcached\n* OpenTelemetry distributed tracing (automatic when SDK is present)\n\nThe name is a variant of Salvador Dali for his famous painting [The Persistence of Memory](http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FThe_Persistence_of_Memory).\n\n## Requirements\n\n* Ruby 3.3 or later (JRuby also supported)\n* memcached 1.6 or later\n\n## Configuration Options\n\n### Namespace\n\nUse namespaces to partition your cache and avoid key collisions between different applications or environments:\n\n```ruby\n# All keys will be prefixed with \"myapp:\"\nDalli::Client.new('localhost:11211', namespace: 'myapp')\n\n# Dynamic namespace using a Proc (evaluated on each operation)\nDalli::Client.new('localhost:11211', namespace: -> { \"tenant:#{Thread.current[:tenant_id]}\" })\n```\n\n### Namespace Separator\n\nBy default, the namespace and key are joined with a colon (`:`). You can customize this with the `namespace_separator` option:\n\n```ruby\n# Keys will be prefixed with \"myapp\u002F\" instead of \"myapp:\"\nDalli::Client.new('localhost:11211', namespace: 'myapp', namespace_separator: '\u002F')\n```\n\nThe separator must be a single non-alphanumeric character. Valid examples: `:`, `\u002F`, `|`, `.`, `-`, `_`, `#`\n\n## Security Note\n\nBy 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:\n\n```ruby\nDalli::Client.new('localhost:11211', serializer: JSON)\n```\n\nSee the [5.0-Upgrade.md](5.0-Upgrade.md) guide for upgrade information.\n\n## OpenTelemetry Tracing\n\nDalli automatically instruments operations with [OpenTelemetry](https:\u002F\u002Fopentelemetry.io\u002F) when the SDK is present. No configuration is required - just add the OpenTelemetry gems to your application:\n\n```ruby\n# Gemfile\ngem 'opentelemetry-sdk'\ngem 'opentelemetry-exporter-otlp' # or your preferred exporter\n```\n\nWhen OpenTelemetry is loaded, Dalli creates spans for:\n- Single key operations: `get`, `set`, `delete`, `add`, `replace`, `incr`, `decr`, etc.\n- Multi-key operations: `get_multi`, `set_multi`, `delete_multi`\n- Advanced operations: `get_with_metadata`, `fetch_with_lock`\n\n### Span Attributes\n\nAll spans include:\n- `db.system`: `memcached`\n- `db.operation`: The operation name (e.g., `get`, `set_multi`)\n\nSingle-key operations also include:\n- `server.address`: The memcached server that handled the request (e.g., `localhost:11211`)\n\nMulti-key operations include cache efficiency metrics:\n- `db.memcached.key_count`: Number of keys in the request\n- `db.memcached.hit_count`: Number of keys found (for `get_multi`)\n- `db.memcached.miss_count`: Number of keys not found (for `get_multi`)\n\n### Error Handling\n\nExceptions are automatically recorded on spans with error status. When an operation fails:\n1. The exception is recorded on the span via `span.record_exception(e)`\n2. The span status is set to error with the exception message\n3. The exception is re-raised to the caller\n\n### Disabling Instrumentation\n\nTo disable instrumentation at runtime (e.g., in tests or specific environments):\n\n```ruby\nDalli::Instrumentation.disable!\n```\n\nYou can also assign a custom tracer directly:\n\n```ruby\nDalli::Instrumentation.tracer = my_custom_tracer\n```\n\n### Zero Overhead\n\nWhen 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.\n\n![Persistence of Memory](https:\u002F\u002Fupload.wikimedia.org\u002Fwikipedia\u002Fen\u002Fd\u002Fdd\u002FThe_Persistence_of_Memory.jpg)\n\n\n## Documentation and Information\n\n* [User Documentation](https:\u002F\u002Fgithub.com\u002Fpetergoldstein\u002Fdalli\u002Fwiki) - The documentation is maintained in the repository's wiki.  \n* [Announcements](https:\u002F\u002Fgithub.com\u002Fpetergoldstein\u002Fdalli\u002Fdiscussions\u002Fcategories\u002Fannouncements) - Announcements of interest to the Dalli community will be posted here.\n* [Bug Reports](https:\u002F\u002Fgithub.com\u002Fpetergoldstein\u002Fdalli\u002Fissues) - If you discover a problem with Dalli, please submit a bug report in the tracker.\n* [Forum](https:\u002F\u002Fgithub.com\u002Fpetergoldstein\u002Fdalli\u002Fdiscussions\u002Fcategories\u002Fq-a) - If you have questions about Dalli, please post them here.\n* [Client API](https:\u002F\u002Fwww.rubydoc.info\u002Fgems\u002Fdalli) - Ruby documentation for the `Dalli::Client` API\n\n## Development\n\nAfter checking out the repo, run `bin\u002Fsetup` to install dependencies. You can run `bin\u002Fconsole` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\n## Contributing\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute, including our policy on AI-authored contributions.\n\n## Appreciation\n\nDalli would not exist in its current form without the contributions of many people.  But special thanks go to several individuals and organizations:\n\n* Mike Perham - for originally authoring the Dalli project and serving as maintainer and primary contributor for many years\n* Eric Wong - for help using his [kgio](http:\u002F\u002Fbogomips.org\u002Fkgio\u002F) library.\n* Brian Mitchell - for his remix-stash project which was helpful when implementing and testing the binary protocol support.\n* [CouchBase](http:\u002F\u002Fcouchbase.com) - for their sponsorship of the original development\n\n\n## Authors\n\n* [Peter M. Goldstein](https:\u002F\u002Fgithub.com\u002Fpetergoldstein) - current maintainer\n* [Mike Perham](https:\u002F\u002Fgithub.com\u002Fmperham) and contributors\n\n\n## Copyright\n\nCopyright (c) Mike Perham, Peter M. Goldstein. See LICENSE for details.\n","Dalli 是一个高性能的纯 Ruby 客户端，用于访问 memcached 服务器。它支持简单的和复杂的 memcached 配置、实例间的故障转移、细粒度的数据序列化和压缩控制，并且能够在多线程环境中安全运行。此外，Dalli 还提供了 SSL\u002FTLS 连接功能以及与 OpenTelemetry 的集成以支持分布式追踪。该客户端适用于需要高效缓存解决方案的各种 Web 应用场景中，尤其是在使用 Ruby 开发的应用程序里，能够显著提高数据读写速度并减少数据库负载。","2026-06-11 03:14:50","top_language"]