Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create initial Meta stores #11

Open
christhekeele opened this issue Oct 31, 2016 · 0 comments
Open

Create initial Meta stores #11

christhekeele opened this issue Oct 31, 2016 · 0 comments

Comments

@christhekeele
Copy link
Owner

Implementing functional composition for stores would be pretty cool.

The idea is a simple as creating a store that can be initialized with references to other stores, and implementing the core operations in such a way that the apply to constituent stores in different ways.

For example, a Mnemonix.Meta.MigrationStore might be initialized with a new and old store, and:

def fetch({old, new}, key) do
  if key in old do
    value = fetch old, key
    put new, key, value
    delete old, key
    value
  else
    fetch new, key
  end
end

Additional candidates for initial implementation would be a ReplicaStore that reads from one and writes to many, with some sort of way to fail over on crash, or a PoolStore that reads from first available one and writes to many. All of these would have some hard decisions to make on handling the features sets like expiration, transactions, and supervision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant