0.01
Low commit activity in last 3 years
No release in over a year
ActiveSupport Cache Store for DynamoDb
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

DynamoDB Adapter for ActiveSupport Cache

Installation

Add this line to your application's Gemfile:

gem 'dynamo-store'

And then execute:

bundle

Or install it yourself as:

gem install dynamo-store

Usage

DynamoStore provides an adapter layer ActiveSupport::Cache to DynamoDB. A serverless key-value store offering millisecond recall and write time.

DynamoStore leverages to the DynamoDB TTL column to automatically remove items as they reach expiration time, this feature should be enabled, as this adapter does not implement any manual cleanup steps.

Configuration

All configuration options are passed during construction of the store. You may also provide the arguments given to the superclass ActiveSupport::Cache::Store.

Configuration Type Default Description
table_name string None. Required The name of the DynamoDB Table
dynamo_client Aws:::DynamoDB::Client Default AWS SDK Client The client to use for connections. Useful for directing the cache at a local installation
hash_key string 'CacheKey' The name of the hash key for the cache table
ttl_key string 'TTL' The colum to use for auto-ttling items

Rails

# in config/application.rb

config.cache_store = :dynamo_store, {table_name: 'AppCache'}

Outside of Rails

require 'dynamo-store'

cache = ActiveSupport::Cache::DynamoStore.new(table_name: 'AppCache')