Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Need a NoSQL key/value DB with these properties...
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Need a NoSQL key/value DB with these properties...

raindog308raindog308 Administrator, Veteran

I need a NoSQL key/value DB with the following properties/features:

  • multiple nodes, each with a complete set of the data (for redundancy). Replication by the DB to keep nodes in sync. Three nodes involved. They're on different continents but I don't care about performance (much).

  • Must be write-consistent. The app does lots of reads, which any node can satisfy since every node has the full DB. But if I do a write, I want it to propagate to all nodes before it returns. In theory I could instead do consistent reads (if there is a flag for such), but the read side is much more frequent and most systems that offer consistent reads query all nodes, which is inappropriate here since all nodes have the full DB already.

  • Ideally, a golang client, since that's my dev language.

  • I just need to store strings. If I can store ints, great.

  • I do need directories or grouping or pathing or some way to say "these keys are all in one group". And then the ability to list all the keys in that directory/group/etc.

  • Ideally not a memory pig as this will run on a 512 or 1024. We're talking under 1GB of data probably forever.

I don't really need indexing or search. Retrieval by key value is sufficient.

There's etcd, which is what I'm using at the moment, though it's not really billed as a NoSQL DB...just curious what else is out there...? Anything billed as "eventual consistency" is not going to work. I'm pretty sure Redis, MongoDB, Cassandra, ElasticSearch, CouchDB, and Riak don't support what I need, but would be delighted to be proven wrong.

https://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis

Comments

  • Cassandra works for multiple nodes + write consistency (Use write consistency ALL as per https://docs.datastax.com/en/cassandra/3.x/cassandra/dml/dmlConfigConsistency.html)
    It fails the not-a-memory-pig part though.

    If you're just storing strings, Redis is good, but it fails the 'eventual consistency' test.

  • Awmusic12635Awmusic12635 Member, Host Rep

    raindog308 said: But if I do a write, I want it to propagate to all nodes before it returns

    before the write returns or the new reads return?

  • lbftlbft Member
    edited August 2016

    Dumb question: why does it have to be NoSQL? I haven't looked in incredible detail, but skimming through I'd imagine either MySQL (or derivatives) or Postgres should be able to meet your needs with careful configuration.

  • raindog308raindog308 Administrator, Veteran

    @Awmusic12635 said:

    raindog308 said: But if I do a write, I want it to propagate to all nodes before it returns

    before the write returns or the new reads return?

    The write...or put another way, to use the SQL phrasebook, it's a global ACID transactional commit. Once I invoke save(), store(), commit() or whatever, when that returns I know it's stored on all servers. Most SQL engines mark the timestamp when your query begins and gives you an "as of" that time frame...I haven't really thought about it that deeply, but I would want the engine to sort out any phantom-row/record problems, etc. MVCC-ish or other reasonable approach.

    @lbft said:
    Dumb question: why does it have to be NoSQL? I haven't looked in incredible detail, but skimming through I'd imagine either MySQL (or derivatives) or Postgres should be able to meet your needs with careful configuration.

    Actually, I'm an old school DBA by trade, so SQL would be fine. In fact, heresy, you can implement nearly any kind of NoSQL in a SQL DB :-) Here are the options:

    • Oracle Enterprise Edition, at a list price of $47,500 per core per server. Nyet.

    • I don't think this is possible in MSSQL today.

    • I don't know IBM DB/2 or Informix well enough to say but I suspect not.

    • Postgres does not support this. Postgres-XC and stuff are out there but they all look scary beta to me.

    • Mysql does not support this, but Percona XtraDB does, and in fact I have that running. I was just considering other options, as Percona is pretty heavyweight.

    ajgarett said: It fails the not-a-memory-pig part though.

    http://wiki.apache.org/cassandra/CassandraHardware

    "The most recently written data resides in memory tables (aka memtables), but older data that has been flushed to disk can be kept in the OS's file-system cache. In other words, the more memory, the better, with 4GB being the minimum we typically recommended in a virtualized environment (e.g., EC2 Large instances). Obviously there is no benefit to having more RAM than your hot data set, but with dedicated hardware there is no reason to use less than 8GB or 16GB, and you often see clusters with 32 GB or more per node."

    OTOH, they're surely engineering for high performance...since it's running in a JVM I'm assuming we're into bigger memory but now I'm tempted to see if I can get it running reliably in a 512 or 1024...

    Thanked by 1lbft
  • lbftlbft Member

    raindog308 said: Actually, I'm an old school DBA by trade

    Oh. DBAs are those evil guys just love to make developers' lives harder by making them jump through ridiculous hoops like "considering performance" and "not making dumbass schema changes", right?

    raindog308 said: In fact, heresy, you can implement nearly any kind of NoSQL in a SQL DB :-)

    But then they won't be web scale.

  • Cassandra does not run well in systems with less than 4 GB of ram. You really need to test your system if you're running 1 GB of RAM.

  • raindog308raindog308 Administrator, Veteran

    lbft said: Oh. DBAs are those evil guys just love to make developers' lives harder by making them jump through ridiculous hoops like "considering performance" and "not making dumbass schema changes", right?

    http://dbareactions.com/post/148644057489/when-the-developer-demands-admin-rights-in

    Thanked by 1vimalware
  • Try out Aerospike

  • vimalwarevimalware Member
    edited August 2016

    The coreOS team do run functional failure testing on etcd with 25MB worth of data (hundreds of thousands of 100byte records)
    source :
    https://coreos.com/blog/new-functional-testing-in-etcd/

    No idea about performance over several 100s of ms latency.

    edit: looks like under 1gb is already being done https://chromium.googlesource.com/external/github.com/coreos/etcd/+/HEAD/Documentation/production-users.md

  • gbshousegbshouse Member, Host Rep

    You can take a look at RethinkDB and if you are fine with writing your own replication part (MQ?) at HamsterDB

  • RQLite provides Raft consensus with replicated SQLite for storage. The read level consistency is configurable. Strong read consistency would require going through the leader so you dont get stale writes. If staleness is not a big issue - weak, or none will do just fine. And it's in Go

  • raindog308raindog308 Administrator, Veteran

    vimalware said: The coreOS team do run functional failure testing on etcd with 25MB worth of data (hundreds of thousands of 100byte records)

    Yep, etcd works great, though it's more a config store than intended to be a full-on NoSQL. But I'm presently abusing it as such...

    rincewind said: RQLite provides Raft consensus with replicated SQLite for storage. The read level consistency is configurable. Strong read consistency would require going through the leader so you dont get stale writes. If staleness is not a big issue - weak, or none will do just fine. And it's in Go

    Nice! Will look at.

    I'm debating changing the app to be more append-oriented, in which case eventual consistency would work better. Now off to google for low-memory eventual consistency NoSQL...:-)

  • raindog308 said: eventual consistency

    Eventual consistency is the same as read-level consistency = none, I think...

    Here's the link RQLite consistency

  • TWoTWo Member

    @raindog308 said:
    I'm debating changing the app to be more append-oriented, in which case eventual consistency would work better. Now off to google for low-memory eventual consistency NoSQL...:-)

    What does that mean for you "eventual" consistency?

    Apart from etcd I'm not aware of any NoSQL like which would cover your "write consistent" requirement. Probably Couchbase can be configured to act "write consistent".

    Personally I'm a big fan of REDIS which can fulfill all of your requirements apart from that guaranteed write consistency. It might be probably "hacked" into REDIS using it's LuaScripting but I would not recommend it as it is absue and it might be blocking. I guess that is why it is probably so hard to find a "write consistent" NoSQL - they don't have a concept like "locking".

    If you cannot redesign your application to compensate for the mandatory "write consistency" - why not stick with etcd? As long as it works for you. RBL abuse DNS very successful for a long time now. ;)

  • raindog308raindog308 Administrator, Veteran

    TWo said: why not stick with etcd? As long as it works for you

    etcd has a maximum response - as in http response - of 1.5MB. That means the maximum object you can store is slightly less than that. It's a constant so I could recompile and change it, but the comments suggest it would not be wise to do so, and certainly not tested. It seems to die spectacularly under heavy load, though you really have to push it. Otherwise, it's worked fine in my testing.

    rqlite is fun so far. The HTTP API is its own form of irritation - since you have to go through all the work of JSON encoding, handling 301s to find the leader, etc. But it's a cool idea.

    TWo said: Personally I'm a big fan of REDIS which can fulfill all of your requirements apart from that guaranteed write consistency.

    Sentinel looks complicated...but interesting. Will read more!

    http://redis.io/topics/sentinel

    Thanked by 1vimalware
  • raindog308raindog308 Administrator, Veteran

    rincewind said: RQLite provides Raft consensus with replicated SQLite for storage. The read level consistency is configurable. Strong read consistency would require going through the leader so you dont get stale writes. If staleness is not a big issue - weak, or none will do just fine. And it's in Go

    I ended up like rqlite so much I wrote a client for it:

    https://github.com/raindog308/gorqlite

    Thanked by 2lbft rincewind
Sign In or Register to comment.