# Adapters

> Flipper is built on adapters for maximum flexibility. Regardless of what data store you are using, Flipper can performantly store data in it.

Storage adapters are local to your application, so you'll always have blazing fast feature checks that are always in sync and available—even if Flipper Cloud isn't for some reason.

## Officially Supported

Pick one of our [supported adapters](https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters) and follow the installation instructions:

<table class="table border w-100">
  <tbody class="fs-6">
      <tr>
        <th colspan="2" class="text-start border-top border-2 border-primary bg-primary-subtle">
          <div class="d-flex align-items-center align-content-center justify-content-between">
            <strong class="d-flex align-items-center align-content-center justify-content-start fw-bold fs-5 gap-1">
              <svg class="bi bi-database bi-small" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#database"></use></svg>
              Storage
            </strong>
            <span class="d-block fw-normal text-body-tertiary">
              You definitely need one of these.
            </span>
          </div>
        </th>
      </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/active-record">ActiveRecord</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/active_record.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Production Rails apps</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/moneta">Moneta</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/moneta.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Production Ruby apps already using Moneta</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/mongo">Mongo</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/mongo.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Production Ruby apps already using Mongo</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/redis">Redis</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/redis.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Production Ruby apps already using Redis</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/sequel">Sequel</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/sequel.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Production Ruby apps already using Sequel</span></td>
        </tr>
      <tr>
        <th colspan="2" class="text-start border-top border-2 border-primary bg-primary-subtle">
          <div class="d-flex align-items-center align-content-center justify-content-between">
            <strong class="d-flex align-items-center align-content-center justify-content-start fw-bold fs-5 gap-1">
              <svg class="bi bi-lightning bi-small" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#lightning"></use></svg>
              Cache
            </strong>
            <span class="d-block fw-normal text-body-tertiary">
              Reduce calls to storage to speed things up.
            </span>
          </div>
        </th>
      </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/active-support-cache-store">ActiveSupportCacheStore</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/active_support_cache_store.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Production Rails apps with aggressive caching needs</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/optimization#dalli">Dalli</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/dalli.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Production Ruby apps already using Dalli</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              Redis Cache
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/redis_cache.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Production Rails apps with aggressive caching needs</span></td>
        </tr>
      <tr>
        <th colspan="2" class="text-start border-top border-2 border-primary bg-primary-subtle">
          <div class="d-flex align-items-center align-content-center justify-content-between">
            <strong class="d-flex align-items-center align-content-center justify-content-start fw-bold fs-5 gap-1">
              <svg class="bi bi-tools bi-small" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#tools"></use></svg>
              Extras
            </strong>
            <span class="d-block fw-normal text-body-tertiary">
              Additional functionality to complement primary adapters.
            </span>
          </div>
        </th>
      </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/features/actors#limitations">ActorLimit</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/actor_limit.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Limits the number of actors that can be enabled for a feature (default: 100)</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              Failover
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/failover.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Increasing reliability by failing over to a secondary adapter if primary is unavailable</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/failsafe">Failsafe</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/failsafe.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Graceful failures when an exception is raised</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              Instrumented
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/instrumented.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Instrumenting all adapter operations with ActiveSupport::Notifications</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/read-only">Read Only</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/read_only.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Preventing writes from a Production console</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/strict">Strict</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/strict.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Raising an error if an unrecognized flag is used</span></td>
        </tr>
      <tr>
        <th colspan="2" class="text-start border-top border-2 border-primary bg-primary-subtle">
          <div class="d-flex align-items-center align-content-center justify-content-between">
            <strong class="d-flex align-items-center align-content-center justify-content-start fw-bold fs-5 gap-1">
              <svg class="bi bi-gear bi-small" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#gear"></use></svg>
              Internal
            </strong>
            <span class="d-block fw-normal text-body-tertiary">
              You probably dont need these but here they are.
            </span>
          </div>
        </th>
      </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              Dual Write
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/dual_write.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Read from one adapter but write to two (used by Cloud)</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              Memoizable
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/memoizable.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Prevent subsquent calls to an adapter for the same feature (used by memoizing middleware)</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              Memory
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/memory.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Testing Environments</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              Operation Logger
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/operation_logger.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Stores all adapter operations in memory for verification in tests</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              Poll
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/poll.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Polls for changes from a remote adapter in a background thread but updates local adapter in main thread (used by Cloud)</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              Sync
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/sync.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Keeping two adapters in sync (bits are used in Cloud)</span></td>
        </tr>
      <tr>
        <th colspan="2" class="text-start border-top border-2 border-primary bg-primary-subtle">
          <div class="d-flex align-items-center align-content-center justify-content-between">
            <strong class="d-flex align-items-center align-content-center justify-content-start fw-bold fs-5 gap-1">
              <svg class="bi bi-lightbulb bi-small" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#lightbulb"></use></svg>
              Niche
            </strong>
            <span class="d-block fw-normal text-body-tertiary">
              Highly specialized adapters outside of day-to-day usage.
            </span>
          </div>
        </th>
      </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/http">HTTP</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/http.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Connecting to <a href="/docs/api"><code>Flipper::Api</code></span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/pstore">PStore</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/pstore.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">When a local file is enough or you need something that works with multiple processes like some system tests</span></td>
        </tr>
        <tr class="h-100">
          <td class="d-flex align-items-center align-content center justify-content-between h-100">
              <a class="fw-bold d-inline-block me-2" href="/docs/adapters/rollout">Rollout</a>
              <a href="https://github.com/flippercloud/flipper/tree/main/lib/flipper/adapters/rollout.rb" class="icon-link"><svg class="bi bi-github bi-small text-body" fill="currentColor" viewBox="0 0 16 16"><use xlink:href="/vite/assets/bootstrap-icons-sb4yxpby.svg#github"></use></svg></a>
          </td>
          <td class="h-100"><span class="d-block">Migrating from <a href="https://github.com/fetlife/rollout">Rollout</a> to Flipper</span></td>
        </tr>
  </tbody>
</table>


### JavaScript in Rails

In addition to the standard adapters, we wrote <a href="/blog/client-side-feature-flags">a blog post about client-side flags</a> with recommendations and examples of how to expose feature flags to client-side code in Rails apps.'

## Create a new adapter

Don't see an adapter that suits your needs? You can [create your own](/docs/adapters/new). We even provide automatic (rspec and minitest) tests for you, so you know you've built your custom adapter correctly.

## Swapping Adapters

If you find yourself using one adapter and would like to swap to another, you can do that! Flipper adapters support importing another adapter's data. This will wipe the adapter you are wanting to swap to, if it isn't already clean, so please be careful.

```ruby
# Say you are using redis...
redis_adapter = Flipper::Adapters::Redis.new(Redis.new)
redis_flipper = Flipper.new(redis_adapter)

# And redis has some stuff enabled...
redis_flipper.enable(:search)
redis_flipper.enable_percentage_of_time(:verbose_logging, 5)
redis_flipper.enable_percentage_of_actors(:new_feature, 5)
redis_flipper.enable_actor(:issues, Flipper::Actor.new('1'))
redis_flipper.enable_actor(:issues, Flipper::Actor.new('2'))
redis_flipper.enable_group(:request_tracing, :staff)

# And you would like to switch to active record...
ar_adapter = Flipper::Adapters::ActiveRecord.new
ar_flipper = Flipper.new(ar_adapter)

# NOTE: This wipes active record clean and copies features/gates from redis into active record.
ar_flipper.import(redis_flipper)

# active record is now identical to redis.
ar_flipper.features.each do |feature|
  pp feature: feature.key, values: feature.gate_values
end
```
