百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

dynamoid

> 数据库
开源

用于 Amazon DynamoDB 的 Ruby ORM。

611 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

用于 Amazon DynamoDB 的 Ruby ORM。

Dynamoid

Gem Version Supported Build Status Maintainability Coveralls CodeCov Helpers Contributors RubyDoc.info License GitMoji SemVer 2.0.0 Keep-A-Changelog 1.0.0 Sponsor Project

A feature-rich and powerful Ruby ORM for Amazon DynamoDB, designed to provide a familiar ActiveRecord-like experience for Ruby applications.

Key Features

  • ActiveRecord-style DSL: Implements an interface and configuration similar to Rails' ActiveRecord.
  • Querying & Persistence: Provides methods for finding, querying, and updating models.
  • Advanced ORM Features: Supports associations, callbacks, validations, Dirty API, optimistic locking, and type casting.
  • Additional Attribute Types: Supports types not natively provided by Amazon DynamoDB, such as DateTime, Time, and more.
  • Transactions: Supports Amazon DynamoDB transactional operations.

Quick start

Installation

Add Dynamoid to your Gemfile:

ruby
gem 'dynamoid'

Or install it using bundle:

bash
bundle add dynamoid

Alternatively, you can install the gem manually:

bash
gem install dynamoid

Usage

To define a model, include Dynamoid::Document and declare your fields. Dynamoid supports ActiveModel validations and automatic timestamps:

ruby
class User
  include Dynamoid::Document

  field :name                        # Type defaults to :string
  field :email
  field :age, :integer
  field :active, :boolean, default: true

  validates :name, presence: true
  validates :email, format: { with: /@/ }
end

Once defined, you can interact with your models using a familiar API:

ruby
# Create and Save
user = User.create(name: 'Josh', email: '[email protected]')

# Find and Update
user = User.where(email: '[email protected]').first
user.update_attributes(age: 30)

# Querying
users = User.where(active: true).all.to_a

Essential Configuration

Minimal connection settings are required. You can configure Dynamoid in several ways, such as in config/initializers/dynamoid.rb (for Rails) or directly in your setup:

ruby
require 'dynamoid'

Dynamoid.configure do |config|
  config.access_key = 'REPLACE_WITH_ACCESS_KEY_ID'
  config.secret_key = 'REPLACE_WITH_SECRET_ACCESS_KEY'
  config.region = 'REPLACE_WITH_REGION' # e.g. 'us-west-2'
end

Documentation

  • API Reference: Comprehensive documentation for all classes and methods is available on API Reference.
  • User Guides: For detailed overviews and usage examples of specific features, see the online User Guides.

Compatibility

Dynamoid relies on aws-sdk-dynamodb (AWS SDK v3) and activemodel (>= 4.2). It officially supports Ruby >= 2.3 and Rails >= 4.2.

Compatibility is tested against the following versions:

  • Ruby: 2.3 - 4.0 (including JRuby 10.x)
  • Rails: 4.2 - 8.1

Contributing

We welcome contributions to Dynamoid! Please see our CONTRIBUTING.md guide for details on how to get started. Join us!

Security

See SECURITY.md.

License

The gem is available as open source under the terms of the MIT License . See LICENSE for the official Copyright Notice.

Credits

Dynamoid borrows code, structure, and even its name very liberally from the truly amazing Mongoid. Without Mongoid to crib from none of this would have been possible, and I hope they don't mind me reusing their very awesome ideas to make Amazon DynamoDB just as accessible to the Ruby world as MongoDB.

Also, without contributors the project wouldn't be nearly as awesome. So many thanks to:

  • Chris Hobbs
  • Logan Bowers
  • Lane LaRue
  • Craig Heneveld
  • Anantha Kumaran
  • Jason Dew
  • Luis Arias
  • Stefan Neculai
  • Philip White *
  • Peeyush Kumar
  • Sumanth Ravipati
  • Pascal Corpet
  • Brian Glusman *
  • Peter Boling *
  • Andrew Konchin *

* Current Maintainers

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubyaws-dynamodbdynamodbhacktoberfestorm

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库