Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Working with Django
      • Background Jobs in Python
    • Java
      • Working with Maven
      • Java Database Operations
      • Working with Spring Boot
      • Java Advanced Topics
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Add-ons
  • All Add-ons
  • IronCache Key-Value Store as a Service
IronCache Key-Value Store as a Service

This add-on is operated by Iron.io

Elastic, High Performace, Highly Available, Secure Cloud-Based Key/Value Store.

IronCache Key-Value Store as a Service

Last updated February 25, 2021

Table of Contents

  • Getting started
  • Ruby
  • Python
  • PHP
  • Next steps
  • Support

IronCache is an elastic, scalable, highly available, persistent and secure cloud based key/value store. IronCache grows with you on demand, doesn’t evict items (they only expire), and ensures you’ll never need to rebuild your cache. It’s great for persistent and reliable incrementors/counters, and can be accessed through an easy to use REST interface or memcached interface. Used it for short term persistence and long term storage without worrying about losing data.

You also have full visibility into your caches and usage with the Iron.io user interface:

Cache List

Getting started

1) Install the IronCache addon for Heroku:

$ heroku addons:create iron_cache:developer
-----> Adding iron_cache to cold-winter-5462... done, v10 (free)

2) Install the IronCache client library (Ruby Example):

$ gem install iron_cache

3) Configuration: Retrieve Token and Project ID

$ heroku config | grep IRON
IRON_WORKER_PROJECT_ID => 123456789
IRON_WORKER_TOKEN      => aslkdjflaksuilaks

4) Use the installed client lib to interact with your caches (create a cache, get/put/delete an item from a cache, etc.). Client lib is a wrapper over the rest api.

Ruby

First, install the Ruby gem:

$ gem install iron_cache
Fetching: iron_cache-1.4.0.gem (100%)
Successfully installed iron_cache-1.4.0

If you’re building for a Rails application or anything that uses Bundler, add the following to your Gemfile:

gem 'iron_cache'

Ruby usage

This is for the Ruby client, but all clients have the same operations. See the docs for your particular language.

require 'iron_cache'

# Create an IronCache::Client object
@ironcache = IronCache::Client.new

# Get a cache (if it doesn't exist, it will be created when you first post an item
@cache = @ironcache.cache("my_cache")

# Put an item
@cache.put("mykey", "hello world!")

# Get an item
item = @cache.get("mykey")
p item.value

# Delete an item
item.delete # or @cache.delete("mykey")

# Increment an item in the cache
item = @cache.increment("mycounter", 1)
p item

Python

Install with pip/easy_install

iron_cache_python is available in the Python Package Index as “iron_cache”. This means you can run pip install iron_cache or easy_install iron_cache from your command line to download iron_cache_python and all its dependencies.

Install from source

You can also download the source from Github. Once you have the source, you can run python setup.py install from the directory containing the source code to install iron_cache_python.

Note: You will need the iron_core_python module for iron_cache_python to function.

Python usage

from iron_cache import *

# Create an client object
cache = IronCache()

# Put an item
cache.put(cache="test_cache", key="mykey", value="Hello IronCache!")

# Get an item
item = cache.get(cache="test_cache", key="mykey")
print item.value

# Delete an item
cache.delete(cache="test_cache", key="mykey")

# Increment an item in the cache
cache.increment(cache="test_cache", key="mykey", amount=10)

PHP

Install

Download iron_cache.phar from from Github and require it in your code:

<?php
require_once "phar://iron_cache.phar";

PHP usage

<?php
require_once "phar://iron_cache.phar";

# Create a client object
$cache = new IronCache();
$cache->setCacheName('my_cache');

# Put an item
$cache->put("mykey", "hello world!");

# Get an item
$item = $cache->get("mykey");
echo $item->value

# Delete a message (you must delete a message when you're done with it or it will go back on the queue after a timeout
$cache->delete("mykey");

# Increment an item in the cache
$cache->increment("mykey", 1);

Next steps

You can find full documentation at the Iron.io Dev Center.

Support

Issues should get logged with Heroku Support. You’re also welcome to stop by the Iron.io support chat room and chat with Iron.io staff about issues. You can also find more resources at the Iron.io Dev Center.

Keep reading

  • All Add-ons

Feedback

Log in to submit feedback.

Ziggeo IronMQ Message Queue as a Service

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences