5 ms·
Here's what I understand: at any one time a Keyspace cluster has one master server which ALL writes go to - the other servers in the cluster replicate from it.
by simonw 17y ago
Here's what I understand: at any one time a Keyspace cluster has one master server which ALL writes go to - the other servers in the cluster replicate from it. If the master goes down another master is elected automatically, giving you your fault tolerance.
You can only write to the current master, and reading from slaves may suffer from replication lag - so if you need to write and then read back the same value you need to read against the master as well.
Your underlying storage is BerkeleyDB, so your write speed is limited to BerkeleyDB's write speed (which is pretty fast). If I wanted to scale writes I'd need to run multiple sharded keyspace instances, in the same way I might run sharded MySQL databases.
Is this accurate, or did I misunderstand something?
- Maro 17y agoIt is accurate and contains no misunderstanding. Some terminology: we differentiate safe-reads, which go through the master and always reflect previous writes which have been OK'd and dirty-reads, which can go through any server, even if no other servers are up; there are absolutely no guarantees with dirty-reads, but it scales linearly, although this is not the indented primary use-case of Keyspace. Keyspace does not contain horizontal partitioning aka. sharding, we plan to build such a layer on top of Keyspace. The exact details of this layer are still being debated, so it its exact position in design space is unclear --- it partly depends on input we get from this release.
- ShabbyDoo 17y agoThis sounds much like the way we were using MySQL when I worked on a large consumer site. We both sharded and replicated to scale out. And, we used MemCached to bridge the replication lag. For better or worse, all writes auto-committed independently. What strategies should Keyspace users employ to counteract similar replication delay issues? I presume Keyspace would offer much better performance because it doesn't have to worry about 95% of the stuff a SQL db does. Drizzle seems like it falls somewhere in the middle of the solution in the above paragraph and Keyspace. Is that a fair assessment? One thing I wanted (among many) with our solution was the ability to specify async disk forcing (an oxymoron?). I'm willing to allow a database to return control to me before writing if it thinks it will be able to write something to disk within N seconds. The increase in performance for most non-transactional systems (meaning that a few seconds of data loss occurring once a year wouldn't hurt too badly) would more than make up for the risk. Terracotta, Gigaspaces, etc. are interesting to me because they facilitate async persistence.
- agazso 17y agoWithout being familiar with the details of your use-case, one of the nice properties of Keyspace is that it is a high-performance (async, C/C++, epoll on Linux) UNIX server --- we are able to get 100.000 writes/sec with n=3 replication on fast Linux PCs with SCSI disks. If you use memcached appropriately, then I suppose Keyspace should be able to handle the "remaining" reads and writes? With Keyspace, you currently cannot turn off disk syncs --- note that Keyspace is still very fast with disk syncs --- as this would break our replication algorithm, Paxos. We might make this an option if users request, which would result in a weird replication consistency somewhat like "eventual consistency", but differing from what is usually refered to under this term. Btw, making this an option is quite easy, roughly 2 minute of work (TXN_NOSYNC with BDB).
- andrewf 17y agoSomething I noticed here and on your blog - I recommend you adopt the American comma convention for writing "100.000". Many people will read that as one hundred (with a decimal point); 10e6 is a lot more interesting than 10e3!
- sparky 17y ago1.0e5 is a lot more interesting than 1.0e2 :P
- ShabbyDoo 17y agoWe were writing first to the master MySQL instance and then immediately putting the same data in memcached. When we read, we'd go to memcached first and then go to one of the read slaves. This way we would limit the effects of replication delay. Note that I don't necessarily like this scheme, but it's the one we used. Is there a replication delay issue with Keystore?