327 points · by luu · 3y ago · 88 comments
> The data is assumed to be randomly distributed to memory nodes in the shared memory pool. Any memory node is equi-distant to any compute node, and a compute node needs to reach multiple memory nodes for transaction execution.
and also:
> Once a memory server fails, NAM-DB halts the complete system and recover all memory servers to a consistent state from the last persisted checkpoint. The recovery procedure is executed by one dedicated compute server that replays the merged log for all memory servers.
>This global stall is problematic for production, but NAM is a research proof-of-concept system. Maybe using redundancy/quorums would be a way to solve this, but then that could be introducing challenges for consistency. Not straightforward.
Yeah, research and proof-of-concept sounds about right. Some might even call it a toy database.
Also worth noting that this is a paper from 2016/2017. The world of (actually!) distributed database design has significantly moved on since then.
What are some of the significant movements since then?
distributed transactions that can assume fast and reliable access to some shared memory are interesting but really the easy part of the problem
"scale" means going across large physical distances where neither low latency nor high availability can be assumed, so not in a single datacenter where nodes are connected by infiniband or whatever
Way back in 2015, MySQL Cluster (NDB Cluster engine) benchmarked 200m transactions/second on commodity hardware [1]. It was read-committed transactions, not snapshot isolation, but still impressive. NDB (or RonDB, the new DB by its author) uses a non-blocking 2-phase commit protocol (failed transaction coordinators are failed over) and is even open-source. Still, it hasn't had a big impact outside of the Telecom and real-time gaming worlds.
[1] https://www.slideshare.net/frazerClement/200-million-qps-on-...
FoundationDB, TiKV, CitusData's Postgres extension are very well known, but RonDB looks like a hidden gem.
What are the practical issues with RonDB that it is not widely known(or used?)?
I think reasons for slow adoption are probably a mix of:
1. Lack of developer awareness.
2. Security implications (or perceived implications) of exposing memory directly to a network without passing through CPU or application-level access control mechanisms.
The second point may be prohibitive for a lot of general purpose database systems which are intended to be run on shared infrastructure on virtualized instances.
Another reason may be that a lot of production systems are CPU-bound, not memory-bound. RDMA seems ideal for systems which require a lot of memory. I'm thinking maybe with recent advancements in AI/LLMs, it could be an interesting technology as these do require a huge amount of memory relative to CPU.
Basically, we are stuck in a local minima of making databases work well in cloud environments that are not designed to enable efficient distributed databases. It is wasteful and also provides an arbitrage opportunity for cloud companies.
- this paper
- dedicated bandwidth (Azure gives you bandwidth based on instance size)
- XDP on network interface
Probably more, but those are what I know of from running into their non-existence.
Systems limited by memory as in "quantity of" are scarse
The experimental setup involves using a cluster of 56 machines connected by an InfiniBand FDR network
That bit might have something to do with it.A bulk purchase of ~60 FDR IB cards, cabling, and network switches to support them sounds pretty expensive.
That being said, IB FDR gear is "older tech" now so the cards and switches can commonly be found reasonably cheaply on Ebay. The switches tend to be bloody loud though, so they're not something you'd want nearby if you can help it.
The idea that one of many writer-compute-nodes can literally reach into a memory buffer that is shared across machines, atomically flip some lock bits and propagate some cache-coherence messages, and use that to build a multi-writer distributed database without needing to partition (and where any writer-compute-node can handle any message, so you can just round-robin a firehose of messages at them)... and that there's a chance (though not yet implemented) that one could implement ACID on top of this? It's absolute madness, and wildly exciting.
At least now I can provision Cloud Spanner as a managed service, but is this the future of clouds keeping their services at an advantage?
It’s amazing what you can get, if you just ask. It’s the latter part you really want, which is doable with modern hardware accelerated time stamping and a peering NTP system (like chrony).
PTP is often used now in the Telco world as well as for broadcasting applications.
Sarcasm aside, their NTP servers are less than 2 hops from my router. I know that because of excellent tools like ping and trace route.
Most machines will also know it is 8:11.
The question is how much resolution do you need and are your clocks accuratly synced enough for the thing you plan to do.
You are aware that many of the physics experiments that operate at the edge of what is possible use extremely accurate clocks synced over national and sometimes continental borders?
¹ let's ignore the ones that have been configured incorrectly
crazy customer needs is what made up most projects I saw or worked with.
I in fact think once you offer atomic clock as a service for any public cloud, distributed transactions become a lot easier to implement thereby disrupting Spanner.
It reminds me specifically of 90's multi-client LAN database systems (dBase, Clipper) where clients coordinated via file locks. Unreliability & hangs became a big problem for us.
In the summarized RDMA database, I'd be pretty concerned about reliability & integrity:
1) Crashed servers will leave records locked, and the system will hang. 2) Question whether lock timeouts can be adjudicated reliably. 3) Any errors in server behaviour can easily & widely corrupt data across any other nodes. 4) Overall the RDMA coordination makes me cautious. Can we really replace Paxos with RDMA reliably? If not, problems squeeze out elsewhere. 5) Proposed single-threaded recovery procedure sounds a hazardous operational bottleneck. 6) I'm also cautious about coordination requirements around recovery/ or to transact knowing that recovery is not in process, unless we can show that can be reliable & not add cost to the protocol.
I implemented multiversion concurrency control in Java with threads but I want to raise it to multimachine.
The problem I have is that the read and write timestamps need to be available to detect if a transaction between machines conflicts.
How do I synchronize read and write timestamps with minimal latency?
When a database replica receives a transaction for key X, it needs (a) a timestamp that is globally accurate (b) needs to tell other replicas about it so they can detect dangerous read-write dependencies.
I feel it inherently requires serialisation of timestamps to accurately determine what other nodes are doing with data.
Otherwise you get dangerous read-write skew.
(See the whitepaper "Serializable Snapshot Isolation")
Load balancers don't do much work, except shift traffic. I wonder if a load balancer that collects timestamps and enriches requests with timestamp information would be a scalable solution?
Also see https://tikv.org/deep-dive/distributed-transaction/timestamp...
Cockroachdb describes their approach here: https://www.cockroachlabs.com/blog/living-without-atomic-clo...
Everything is direct memory access.
SNA protocol, No TCP. This is used since the 70s by many banks to process high volume transactions
RDMA (remote direct memory access) is a zero-copy communication standard.
RDMA is a user-space networking solution, accessed via queue pairs: lock-free data structures shared between user code and the network controller (NIC), consisting of a send queue and a receive queue.
RDMA supports several modes of operation [such as] reliable two-sided RDMA operations, which behave similarly to TCP. With this mode, the sender and receiver bind their respective queue pairs together, creating a session fully implemented by the NIC endpoints.
Once a send and the matching receive are posted, the data is copied directly from the sender’s memory to the receiver’s designated location, reliably and at the full rate the hardware can support.
A completion queue reports outcomes. End-to-end software resending or acknowledgments are not needed: either the hardware delivers the correct data (in FIFO order) and reports success, or the connection breaks.
> Is RDMA mature (robust/reliable) enough to use in distributed transactions?
At least on Linux systems, RDMA has been pretty robust/reliable for probably a decade, maybe more. > What are the handicaps?
It works differently to TCP/IP, which everyone in IT has at least passing familiarity with. So, it tends to be automatically passed over unless people hit a situation where they're open to "exotic" solutions.That being said, there's a TCP/IP shim layer (IPoIB) available which can be used by existing software to run on an IB network.
That shim layer though used to have a reputation for flakiness, and it was (or at least used to be) measurably slower than using native IB.
> What are the reasons for slow uptake on this?
Repeated self-inflicted foot-guns by Mellanox leadership or perhaps their sales and marketing leadership is my best guess.Mellanox adapters when brand new are priced fairly high for network adapters, or at least they used to be. However, when a network using them is upgraded to the next generation gear, a substantial number of the old ones would commonly end up for ~cheap resale on places like Ebay.
So, *nix DevOps staff ("Sysadmins" back in the day) and anyone else that needed fast networking for their home labs and similar would pick them up and figure out how use them.
Which of course meant over time an increasing group of people familiar with IB, that when figuring out solutions for their work places would then have enough confidence and knowledge to order them.
Sounds like typical organic growth right?
<rant>
Except Mellanox leadership - or at least their Sales & Marketing people - seemed to be fucking horrified that people were buying their expensive adapters cheaply on Ebay.
So, while the Mellanox technical people were receptive to this ground swell growth in usage by "unofficial" people, and tried to help out, their leadership time and time again did their level best to stamp it out.
Including killing off one of their decent "Community" growth initiatives -> just turned it into a fucking marketing channel for press releases and other crap <- Ugh.
But also doing things like instructing their support staff to not answer anyone on their forums who seemed to have purchased their gear through unofficial channels, etc. Nor let anyone else do so.
There were many, many examples of this bullshit over the years. And they were always like "Why don't we have huge adoption?"
Gee, I wonder? :( :( :(
</rant>
Anyway, I gave up on them and moved on a few years afterwards, prior to Nvidia buying them. I still buy older Mellanox ConnectX-3 (VPI) adapters off Ebay occasionally for home gear use (with Linux), and they're still solid. 10/40GbE. :)
The two papers mentioned in the post are highly insightful. This is one of my favorite subjects.
To fully disclose, I have a biased view on this given that I work for a (closed source) serverless, no-ops DB provider (Fauna) that implements a distributed transaction engine that is natively document-relational and doesn't compromise on relational (ACID, transactional) guarantees.
The particular timestamp oracle implementations still might suffer from metadata bloating and its commit protocol assumes an optimistic segment lock which would be a bottleneck in multiple scenarios.
So, from what I understand this is a (good?) practical speedup for some scenarios but doesn't change the fact that it's not possible to make an arbitrary sytem distributed without sacrificing correctness or throughput.
An easy reasoning: imagine that every node is one light year apart from all others.
I’m curious to see what advantages this paper offers to everyday Cloud Developers over using the latest version of Cassandra.