
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
Organize and store Ruby objects in Valkey/Redis. A powerful Ruby ORM (of sorts) for Valkey/Redis.
Familia provides a flexible and feature-rich way to interact with Valkey using Ruby objects. It's designed to make working with Valkey as natural as working with Ruby classes, while offering advanced features for complex data management.
# Add to Gemfile
gem 'familia', '>= 2.0.0'
# Or install directly
gem install familia
# config/initializers/familia.rb (Rails)
# or at the top of your script
require 'familia'
# Basic configuration
Familia.uri = 'redis://localhost:6379/0'
# Or with authentication
Familia.uri = 'redis://user:password@localhost:6379/0'
class User < Familia::Horreum
identifier_field :email
field :email
field :name
field :created_at
end
# Create
user = User.new(email: 'alice@example.com', name: 'Alice')
user.save
# Find
user = User.load('alice@example.com')
# Update
user.name = 'Alice Smith'
user.save
# Check existence
User.exists?('alice@example.com') #=> true
redis (automatically installed)flower = Flower.create(name: "Red Rose", token: "rrose")
flower.owners.push("Alice", "Bob")
flower.tags.add("romantic")
flower.metrics.increment("views", 1)
flower.props[:color] = "red"
flower.save
rose = Flower.find_by_id("rrose")
rose.name = "Pink Rose"
rose.save
user = User.create(username: "rosedog", first_name: "Rose", last_name: "Dog")
user.safe_dump
# => {id: "user:rosedog", username: "rosedog", full_name: "Rose Dog"}
metric = DailyMetric.new
metric.counter.increment # Increments the counter for the current hour
Flower.multiget("rrose", "tulip", "daisy")
user.transaction do |conn|
conn.set("user:#{user.id}:status", "active")
conn.zadd("active_users", Time.now.to_i, user.id)
end
For large applications, you can organize model complexity using custom features:
# app/features/customer_management.rb
module MyApp::Features::CustomerManagement
Familia::Base.add_feature(self, :customer_management)
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def create_with_validation(attrs)
# Complex creation logic
end
end
def complex_business_method
# Instance methods
end
end
# models/customer.rb
class Customer < Familia::Horreum
field :email, :name
feature :customer_management # Clean model definition
end
This keeps complex models organized while maintaining Familia's clean, declarative style.
Familia provides a powerful and flexible way to work with Valkey-compatible in Ruby applications. Its features like automatic expiration, safe dumping, and quantization make it suitable for a wide range of use cases, from simple key-value storage to complex time-series data management.
For more information, visit:
Contributions are welcome! Feel free to submit a Pull Request.
FAQs
Unknown package
We found that familia demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.