github-ds
GitHub::DS is a collection of Ruby libraries for querying MySQL databases through Rails ActiveRecord. It provides a key-value store, a fluent SQL query builder, and a Result object for error handling—all used in production at GitHub.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | github/github-ds |
| Owner | github |
| Primary language | Ruby |
| License | MIT — OSI-approved |
| Stars | 698 |
| Forks | 27 |
| Open issues | 7 |
| Latest release | Unknown |
| Last updated | 2025-06-11 |
| Source | https://github.com/github/github-ds |
What github-ds is
Comprises three components: GitHub::KV (MySQL-backed key-value store with expiration support), GitHub::SQL (parameterized query builder using ActiveRecord connections), and GitHub::Result (monadic error handling). Designed for Rails applications and requires MySQL.
Get the github-ds source
Clone the repository and explore it locally.
git clone https://github.com/github/github-ds.gitcd github-ds# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Requires MySQL database with root user passwordless access (for local dev/test); Docker Compose setup is provided.
- Must run Rails migration generator (`rails generate github:ds:active_record`) to create the `key_values` table before use.
- Table name for KV store is configurable via `GitHub::KV.configure`; plan for multi-tenancy or multiple stores accordingly.
- KV expiration feature does not auto-purge; schedule external archival jobs to prevent table bloat over time.
- Result object composition requires familiarity with monadic patterns; team training recommended for consistency.
When to avoid it — and what to weigh
- You require a general-purpose cache layer — GitHub::KV is MySQL-specific and not a replacement for Redis or Memcached; it trades off speed for durability and simplicity.
- Your application does not use ActiveRecord or Rails — These libraries are tightly coupled to Rails and ActiveRecord's connection model; they are not suitable for standalone Ruby or non-Rails contexts.
- You need automatic key expiration with row cleanup — GitHub::KV respects expiration but does not purge expired rows automatically; you must run external tools like pt-archiver for maintenance.
- Your schema includes case-sensitive key lookups — MySQL's default collation makes GitHub::KV keys case-insensitive; this may not suit applications requiring strict key differentiation.
License & commercial use
MIT License (OSI-approved permissive license). Permits commercial use, modification, and distribution with attribution.
MIT is a permissive OSI license allowing commercial use without restriction. No license-based barriers to production deployment. However, no warranty or liability protection is provided; review company policy on open-source use.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
Uses ActiveRecord's parameterized bind values, reducing SQL injection risk. KV store keys are case-insensitive due to MySQL collation; verify this does not expose security assumptions. No mention of encryption at rest, audit logging, or access control beyond database permissions. Review threat model for sensitive data storage.
Alternatives to consider
Redis + Kredis (Rails native)
Faster for caching and sessions; simpler operational model for modern Rails apps. Trade-off: external dependency.
Sequel or other query builders
Language-agnostic query builders with similar fluent API; not Rails-specific. Trade-off: less integrated with ActiveRecord ecosystem.
Dry::Monads for Result patterns
Standalone monadic error handling; composable across any Ruby codebase. Trade-off: requires separate adoption for database layer.
Build on github-ds with DEV.co software developers
Review our technical assessment to determine if GitHub::DS fits your caching and query needs, or discuss alternatives for your use case.
Talk to DEV.coRelated on DEV.co
Explore the category and the services that help you build with it.
github-ds FAQ
Is GitHub::DS suitable for high-throughput caching?
Can I use GitHub::DS with non-Rails apps?
How do I handle expired keys in GitHub::KV?
What is GitHub::Result used for?
Software developers & web developers for hire
Need help beyond evaluating github-ds? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source databases integrations — and maintain them long-term.
Evaluate GitHub::DS for your Rails stack
Review our technical assessment to determine if GitHub::DS fits your caching and query needs, or discuss alternatives for your use case.