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

Evaluate existing storage abstractions and other DBs #22

Open
philippgille opened this issue Sep 16, 2018 · 0 comments
Open

Evaluate existing storage abstractions and other DBs #22

philippgille opened this issue Sep 16, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@philippgille
Copy link
Owner

philippgille commented Sep 16, 2018

This issue consists of two kind of seperate tasks, but they're very related to each other:

  1. Existing storage abstractions
  2. Other DBs

Existing storage abstractions

The wall package contains the interface StorageClient and expects it as parameter so the middleware factory functions. It's meant as an abstraction for storage client implementations backed by some distributed or embedded DB / KV store.

It currently has two very ln-paywall-specific methods, but this will probably change in #16:

type StorageClient interface {
	WasUsed(string) (bool, error)
	SetUsed(string) error
}

The storage package contains implementations for Redis, bbolt (formerly known as Bolt DB) and a simple Go map.

This is home-grown and might not offer the best performance and robustness as professionally created storage abstractions.

I looked for existing abstractions and there aren't many, but they should be evaluated:

  • Docker's libkv: Consul, Etcd, Zookeeper (Distributed store) and BoltDB (local store)
  • A fork of libkv, apparently by the former libkv maintainer, valkeyrie: Consul, Etcd, Zookeeper, Redis (Distributed store) and BoltDB (local store)

Other existing, but not popular or well-maintained ones:

Other DBs

Every DB has its pros and cons, and it's always very dependent on the use case which DB is the fastest.

So more DBs should be implemented temporarily, then benchmarked with real use of ln-paywall middleware and then only the DBs that make the most sense should be supported (to not overwhelm developers who want to use ln-paywall with too many storage options).

We should look at least at:

And even if we only need KV, we should look at popular general NoSQL or even SQL DBs as well:

And maybe even some DB-as-as-Service options from the big three cloud providers: AWS, Azure, GCP. This is especially useful if companies want to use ln-paywall but don't want to deal with the administration of a DB, or if they're already using one of the cloud providers anyway, so they're most comfortable in using their products, because they trust them and they know they work well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant