Looking forward to additional use cases I can throw at this beast of a system.
Kudos to you guys!
i.e.
- a SQL interface,
- pre-packaged data structure libraries,
- monitoring,
- limitations of FoundationDB itself,
- etc.
I'm working on a talk for the upcoming FoundationDB Summit and I'd love to address some real-world questions or issues people have.
And of course there's the application side: With SQL and EXPLAIN, I can usually see bottlenecks. I have a latent fear that performance with distributed systems suddenly tanks if some structure is suddenly split across nodes for example.
- the storage backends seem less impressive than the marketing leads you to believe. The default memory backend is obviously too limited to use in production, and the “ssd” backend turns out just to be built on top of the Btree code from SQLite. Besides that, the documentation warns against using the ssd backend on macOS. Isn’t that a bit strange, considering who owns foundationdb??
- while testing, I found that it was impossible to shrink a cluster. If you add a second storage node just to test that the distributed stuff works correctly, you can’t reduce it back to a single node without destroying the entire database and starting over. If it’s possible to run everything on one node, it should be possible to shrink a cluster back to a single node.
- the storage backends have a crazy amount of write amplification (something like 3x, according to the docs). The foundationdb folks should focus on improving the underlying storage, for instance by building on lmdb or RocksDB or something. For my toy app, I abstracted my data access to use either lmdb (for local testing) or foundationdb (for production), but I ultimately ended up just using lmdb because I didn’t want to deal with fdb’s limitations and operational unknowns.
- another weird fdb limitation: the best single threaded latency you’ll get is supposedly around 1ms for small reads. The docs suggest you can achieve much better performance by scaling the cluster and number of clients. That may be true, but some applications may want high single-threaded performance. (Something like lmdb can achieve tens of thousands of reads per second)
On write amplification: a factor of 3x is not actually that unusual. The default RocksDB size amplification is 2x, and I've seen performant LSM trees with about 3x write amplification.
On the single threaded bottleneck: this is an inherent issue you have when you put your database over a network connection. LMDB can do 10k/100k+ reads/sec on a single thread since it's just doing syscalls. As soon as you start to need to distribute your database across more than 1 machine you start to need to parallelize you work for high throughput.
Look under "double" mode or "triple" mode. Is this why it maybe didn't work for you?
One of the huge problems is a lack of consistency constraints. Since during development data make became broken in various ways (and we have done several times). And right now there are no way to implement simplest constraints on database level.
I'd be very interested in usage for time-series, but it looks like to get a working example up I'd need to fully parse the documentation and tutorials in order to do it as there is no "Let's build a Timeseries Database on FoundationDB from scratch"
For example, if you want to read "last 5 minutes" of data, you can keep your timestamp at the end of the key in reverse order (Long.MaxValue - timestamp).
- some way to store ordered records to speed up range query
- comparison & benchmarks of FoundationDB vs other distributed DB like TiDB, CockroachDB, ScyllaDB, etc
1. What is the recommended way to filter on multiple indexes?
2. What is the recommended way to filter on one or more indexes and sort on another or more index(es)
3. If I use FoundationDB as my main datastore, how should I implement full text search?
4. From what I understand, FoundationDB stores keys sorted globally. How does it handle hot spots where a range of keys that is very frequently accessed is on one machine that gets overloaded?
Edit 5. How do you do backups?
What would I even be doing if the coordinator state is missing? That sounds like a critical internal issue to me, is this really something I need to find out and if it is, why does the error not tell me how to check this or repair it?
Another thing: Right after I create a database with 'configure new single memory', I get in 'status': " Moving data - unknown (initializing) Sum of key-value sizes - unknown " Is this really such an edge case that the database cannot give me meaningful information on what is going on with my data right now? That is very scary to me. It should be able to tell me what is going on with the data, this is the simplest possible moment. I just created a database 5 seconds earlier and I run a status command. Now the database is apparently in an unknown state. What I would like to get is a realtime progress bar of where data is moving and why, with percentage numbers indicating the progress and if there is any error it should actually tell me the location of the log file.
The other big question mark is: I dont know if I can truly configure everything correctly so I actually get the performance that is advertised, there seem to be a lot of things I need to consider and configure exactly the right way in order to get the correct performance as I've read on the forums, from the number of processes to start, to all kinds of other configuration issues. Somebody actually made a guide and I'm thankful for this but in my opinion I should not need to worry about any of this, foundationdb should scan what CPUs/disks I have and suggest the optimal solution/configuration. These are simple rules, shouldnt they be automatically done? Imagine how many people are running foundationdb suboptimally just because they didnt know that the default naive way of starting a few processes and letting them do some work is horribly wrong.
The third issue is: What matters is how the performance will look after I did all my fancy custom layers on top and when I had to emulate all the stuff that was builtin by mongodb and whether this thing is actually as reliable and performant as it says it is. When I look at the issues I enumerated in the beginning, it really doesn't feel good to me.
What is the state of production monitoring of FoundationDB?
A SQL interface might lessen the impact of that somewhat, but then I might as well just use Postgres from the start.
Basically, I'm curious to know how FDB's memory engine performs compared to the SSD engine with a standard NAND SSD and an Intel Optane DC SSD. Something along the lines of the throughput per core and latency results on the FDB performance page [2].
[1]: https://github.com/AccelerateWithOptane/lab/issues [2]: https://apple.github.io/foundationdb/performance.html
Disclosure: I'm working at Intel and help manage our open source lab with our friends at Packet.
Most applications will need something higher level, like a SQL or document db frontend which could be built on top.
I'm curios what people have started using FoundationDB for. Any interesting stories to share?
a) Rewrite SQL code. In our case we are using Node.JS and all SQL libraries are very very slow. Even replacing one with another is enormous work. b) Rewrite to a new language. It was also an option since querying Postgres can take 1ms, but parsing response can easily take 100ms+. That trashed our event loop and causes awful latency. c) Rewrite to high performance NoSQL database.
We picked a last one. In context of a Node.js we were able to write really thin layer on top of FDB that works super-fast and in a way we needed.
In my previous startup we eventually ditched all SQL from our codebase too since SQL databases is just too slow for low latency messaging apps. There are no simple way to shard data, there are always random locks around your database (which blocks connections). Locks are really hard to debug sometimes. How to scale single SQL server? All of this is doable, but in FDB it was basically free.
We migrated to FDB and got almost x100 improvement in latency/performance. And unlike SQL-code that was very carefully crafted we can do nasty things. Like - "hey, let's just pull this key every 100ms and check for a new value" or "hey, let's do it on 10s of instances at the same time?". In this situations Postgres started to consume all available CPU. You can easily creep out SQL with a single instance of your app. We haven't managed this to do with FDB for 1/2 of the cost. We are often in situation when someone commit something with a bug and, for example, started to pull data every millisecond in N^2 streams where N is number of online users. In this situations we just can't see any impact at all on our platform. Just spikes in monitoring.
FDB is wonderful thing - it allows you to forget about optimizing performance of your queries, forget about managing backups and replication. It just works!
Ouch. Is that just large amounts of data? Are you guys using pg.native?
Most people don't mind SQL. RDBMS are good enough. People don't want to learn a new thing that's why it's still here and that's why FDB will have a hard time to compete with CockroachDB or TiDB or Spanner.
> document DB frontend which could be built on top
A document database is a low hanging fruit in FDB (except if you want 1-to-1 mapping with MongoDB). But my advice is to stay away from MongoDB API.
What FDB is offering is much more powerful. Think the ease of use of MongoDB with the power of dynamodb + other niceties likes 'watches' (pgsql-like notify), transactions of course and your favorite language to do the queries. Also, FDB works in standalone mode that is you can start using FDB on day one and grow your business with it. All you need is a good layer.
> Any interesting stories to share?
I have been dabbling with key-value stores for 5 years now. So I am definitely biased. Simply said, key-value stores open perspectives you can not imagine, FDB, in particular, is a great great idea and it looks like based on the forums interactions that it's a good (if not fabulous) piece of software.
“it is possible for a transaction C to be aborted because it conflicts with another transaction B, but transaction B is also aborted because it conflicts with A (on another resolver), so C "could have" been committed. When Alec Grieser was an intern at FoundationDB he did some simulations showing that in horrible worst cases this inaccuracy could significantly hurt performance. But in practice I don't think there have been a lot of complaints about it.”