131 points · by evanweaver · 9y ago · 159 comments
similar to a RethinkDB/MongoDB:
* Designed to be great for storing application data. Fields can be dynamically added (schemaless) and their values can be arrays so it is easy to maintain data locality according to your application use patterns.
* Uses a non-SQL query language
* Probably not great for ad-hoc reporting (arguably SQL is a requirement for that)
Unlike MongoDB: supports joins
Unlike RethinkDB: great support for transactions, just not SQL transactions with an open session (which are unnecessary for an application)
Unlike most databases
* cloud-hosted and pay-for-use (on-premise is on their roadmap)
* claims support for graph data by storing arrays of references
* QoS built-in so you could run a slow analytics query without disrupting your application
Cons
* Unfortunately just like MongoDB/RethinkDB they have no real database-level integrity of schema and foreign keys, but at least foreign keys are on their roadmap.
I am a huge fan of the cloud-hosted pay for use aspect: I wonder why anyone would design a DB today without this in mind. You can transfer your data from a pay-for-use application DB (FaunaDB or Google DataStore) to a data warehouse (Snowflake or Google BigQuery) which is also pay for use and gives you SQL reporting abilities.
We're definitely aware that the lack schema definition is a problem for certain use-cases, and solving this is on our roadmap.
2.8 ms to access data within a datacenter is both good and believable. And if I'm building an application, it is a latency figure that matters to me a lot.
Any first-read of "The first serverless database" has the implication that the database is serverless. Comments from FaunaDB folks in this comment page clearly indicate that they mean is that it's the first database for serverless, which is a pretty bold claim, given Google and AWS and any number of other providers offer databases that are accessible from serverless things, so it essentially boils down to "The first database that's marketed specifically to serverless use cases", which is maybe true but also kindof not a useful trophy to put on the mantle?
This is further muddled by the blog post linked to from the launch announcement (https://fauna.com/blog/escape-the-cloud-database-trap-with-s...), which includes "FaunaDB Serverless Cloud is an adaptive, serverless database". Nobody is reading that and thinking "ah, an adaptive database for serverless apps".
To describe it as "The first active-active multi-cloud database", is possibly true if you mean "the first time a single company has sold a publicly-available database-as-a-service running on multiple cloud providers". But the text says "database" where "public database-as-a-service" would be the accurate term, leaving the reader with the impression that no existing databases can be set up on multiple cloud providers in an active-active HA config, which is absurd. Fixing the copy here should be pretty easy, and they're already headed in the right direction with the next bullet point, although it as well refers to "database" where it means "database-as-a-service".
It feels like somebody on marketing really wanted to have a list of firsts, so they toyed with definitions of words until they thought they could flex these into being technically accurate. I get the same feel from the closing argument in the linked blog post: "The query language, data model (including graphs and change feeds), security features, strong consistency, scalability and performance are best in class. There is no downside.". I don't think I want to trust a database if the folks designing it couldn't think of any downsides.
Serverless is supposed to mean: a database with serverless pricing, for serverless applications.
There's always a tension, too, between "does a feature exist somewhere" and "is it actually usable?". For example, you could perhaps run MySQL Cluster across multiple public clouds...but would you want to? It's surprisingly hard to design for true cross-continent global replication, and the additional latency of crossing public clouds makes it even worse.
We've tried to design the best database. We can put in some bugs for you to give it some downsides.
But to tell my your database model has no downsides at all? No use cases where its consistency model isn't optimal, where an implementation detail means that it's not a good fit? Even just skimming the marketing copy, it's clear that if I'm using SQL in my existing app, migrating to FaunaDB has the clear downside that I need to rethink my queries, and that's just the surface layer.
Analytics is the biggest missing feature...it will come. It's also not cost-effective at the moment for timeseries data.
We've updated the posts in light of some of this feedback.
Edit: Thanks to all the commenters who corrected me :)
To provide a non-Google example, AWS DynamoDB's pricing is based on throughput (similar to Google Cloud Datastore).
One technicality: DynamoDB's pricing is based on throughput, as you know, but it's provisioned throughput. (You manage your capacity unit allocations yourself, at least that was the case a little while ago.) You're charged money for how much you provision regardless of whether or not you actually consume the capacity units. Our pricing model (like Fauna's) only takes ops and storage into consideration.
You'll probably find there are a lot of distributed database geeks at Google, me included, so we all get attracted to exciting posts on new distributed systems.
https://firebase.google.com/pricing/
(Disclosure: I work on Cloud Datastore, which is another Google Cloud product; it, too, does pricing based on ops and storage rather than provisioning, as my colleagues note.)
https://cloud.google.com/datastore/pricing
Disclosure: I work on Google Cloud (and sit near the Datastore team!)
We're excited to open our doors and explain more of our design decisions. Our team is from Twitter, and that experience has deeply informed our interface and architecture. Try it out and let us know what you think.
An on-premises release is coming later this year.
By "Serverless", do you just mean DBaaS? "Serverless" in the context of a database is kinda weird because the data does have to be stored somewhere. This branding doesn't make much sense to me.
> It’s relational, but not SQL.
Why not SQL? Is there something your query language supports that SQL doesn't?
> With pay-as-you-go pricing, your database costs nothing when no one is using it. Combine it with a function-as-a-service provider like AWS Lambda or Google Cloud Functions, and your entire cost structure scales dynamically with usage.
In provisioning terms, how is FaunaDB different from existing alternatives like Google Cloud Datastore? What makes it "Serverless"? Are you just saying PAYG = "Serverless"?
Why not? If you already support relational algebra, it seems like a non-brainer to just add SQL. Even if it's only SQL-92 you would be able to support some existing tools/ORMs almost for free.
1: https://fauna.com/blog/distributed-acid-transaction-performa...
2: http://cs.yale.edu/homes/thomson/publications/calvin-sigmod1...
These kind of transactions are also called static, and are normally of the type "I have this read/write operation(s) against multiple keys, go and do it" vs dynamic transactions that might depend on read values from the db to figure out what to do next.
I'd be interested to hear why, and what you would do differently if you were to start from scratch.
It is a long time to go without real world use and user feedback, though.
This looks super neat, and I can't wait to learn more about it, but just for the record: I'm pretty sure this isn't the first serverless cloud database. Both Firebase's Realtime Database and Cloud Datastore (which powers Snapchat and Pokemon Go) are serverless; you pay only for your ops and storage. They've been publicly available for several years.
Both of those depend on other distributed storage systems under the hood, as far as I am aware? Or is Datastore an end to end system? I know Firebase was backed by MongoDB.
Our end users don't have to think much about our storage system, though, if we're doing our jobs right. :)
[1] https://cloud.google.com/datastore/docs/articles/balancing-s... [2] https://cloud.google.com/datastore/docs/concepts/entities
Both ostensibly work best when the application fits a hierarchical data model (entity groups vs. documents), and provide out-of-the-box strongly-consistent transactions for a single entity group. MongoDB feels like schemaless Megastore.
1: https://static.googleusercontent.com/media/research.google.c...
In this case Megastore provides the underly multi-region/datacenter K-V replication services.
All the database features like secondary & composite indexes, query language, multi-tenancy support, PAYG model, etc, etc, are built in the Cloud Datastore layer.
The reasons FaunaDB fits serverless like a glove can be boiled down to a few points: pay-as-you-go, database security awareness and object level access control, hierarchical multi tenancy with quality of service management. Running on multiple clouds makes the Serverless model more acceptable for risk averse enterprises, and complements multi-cloud serverless FaaS execution environments nicely.
There's more to say, check out this post on the blog: https://fauna.com/blog/serverless-cloud-database and https://fauna.com/blog/escape-the-cloud-database-trap-with-s...
"A serverless system must scale dynamically per request. Current popular cloud databases do not support this level of elasticity—you have to pay for capacity you don’t use. Additionally, they often lack support for joins, indexes, authentication, and other capabilities necessary to build a rich application."
That first criterion we absolutely meet, today. Cloud Datastore has been doing that for eight years now. We don't have joins, but we do have indexes, auth, multi-region replication and a whole lot more.
For instance, you could have a fire-and-forget self-service self-provisioning online shopping site builder, and bill database costs through to your customers (we give you that information in response headers).
You can also use FaunaDB to do consistent coordination between FaaS execution environments running in different clouds. So if you like a processing feature Azure makes available, but want to run your user facing servers in GCE, you can use FaunaDB to coordinate between the clouds.
Is that a lot? I think it is. Google Cloud Spanner costs $0.90/hour per node or around $650/mo. Each Cloud Spanner node can do around 10,000 queries per second[1]. So, $650 to Google gets you 10x the queries that $25,920 to Fauna gets you. I mean, for $25,920, you could get a Spanner cluster with 40 servers. Each of those servers would only have to handle 25 queries per second to get you 1,000 queries per second.
I'm sure that people are going to question whether FaunaDB can actually do what it claims. At this pricing, I can't imagine someone actually seeing if they can live up to their claims. They have a graph showing linear scaling to 2M reads per second. Based on their pricing, that would be $630M per year. For comparison, Snapchat committed to spending $400M per year on Google Cloud and another $100M on AWS (and people thought the spend was outrageous even for a company valued at tens of billions of dollars). This is more money for the database alone.
Heck, it looks like one can get 5-20k queries per second out of Google's Cloud SQL MySQL on a highmem-16 costing $1k/mo[2]. That would cost $130k-$500k on FaunaDB. It seems like the pricing of FaunaDB is off by a couple orders of magnitude.
Ultimately, Spanner is something built by people that published a notable research paper and used by Google. Reading the paper, you can understand how Spanner works and be saddened that you don't have TrueTime servers powered by GPS and atomic clocks. FaunaDB has some marketing speak about how I'll never have to worry about things ever again - without telling me how it will achieve that.
It's also implemented in Scala. This isn't a dig on Scala or the JVM, but I use three datastores on the JVM and only one isn't sad for it is Kafka. But Kafka does very little in the JVM - it basically just leans on sendfile to handle stuff which means you don't get bad GC cycles or lots of allocations and copying.
FaunaDB is a datastore without much information other than "it's great for everything and scales perfectly". Well, at their pricing, they might be able to make it happen. I mean, most customers would simply move to something cheaper as they got beyond small amounts of traffic due to the pricing. 60,000 queries per second? That'll be $18M per year from FaunaDB or $50k per year from Google. It's not even in the same ballpark. If you really need to scale to 2M reads per second, $630M seems like a lot more than $1.6M for Spanner.
Maybe it's an easy way to get some money off people that "need a web scale database", but are actually going to be serving like 10 queries per second and are willing to spend $260/mo to serve that. If they hit it big, it shouldn't be insane to scale it to 10,000 queries per second and milk $260k out of them each month for a workload that can be handled by a single machine. That money also pays for decent ops people to run a big box and consult with the customer if they're going towards 100k queries per second with a $2.6M monthly payment.
EDIT: looking over Fauna's blog and some of their comments here, they seem to understand more than their marketing lets on. Daniel Abadi is one of those people whose name carries weight in the databases world (having been involved with C-Store/Vertica, H-Store/VoltDB, and others). While I haven't read the Calvin paper, it looks like a good read. I can see that they are using logical clocks and I can't find it right now, but I thought I saw that they're not allowing one to keep transaction sessions checked out - that all the operations must be specified. So, it seems like there's some decent stuff in there that's currently being obscured by marketing-speak. Still, the pricing seems really curious.
[1] https://cloud.google.com/spanner/docs/instance-configuration
[2] https://www.pythian.com/blog/benchmarking-google-cloud-sql-i...
Reads: >1.1M entities/second Write: >380K entities/second Delete: >190K/second Storage: 100TB
And that's if you don't use any of the nearly free optimizations like Projection queries & keys-only queries, which any large scale customer does.
That's not pre-provisioned usage, it's actual pay-as-you-go usage - so if you have no traffic, you have no costs (except for what's already stored). It's been that way for 8 years too.
[1]: https://cloud.google.com/products/calculator/#id=e21b61d5-4a...
(PM for Cloud Datastore - if you'll looking at 1M+ QPS workloads feel free to message me)
I see where you're coming from. People make the same argument against using cloud services at all when you can buy hardware yourself and operate it. The lack of flexibility is the hidden cost.
Our cloud pricing is competitive with other vendors, most of which require you to massively over-provision in order to get high availability, especially global availability, as well as predictable performance. In traditional cloud databases, you have to provision for peak load. Usually this is an order of magnitude difference from average load. An order of magnitude difference happens to matches your Spanner example exactly; however with Spanner, you still have to manage your capacity "by hand".
Architecture docs are on the way.
You've said that Spanner makes you manage capacity by hand, but the marketing copy says, "FaunaDB is adaptive, because it lets you change your infrastructure footprint on the fly. Dynamically shift resources to critical applications, elastically add capacity during peak events, and replicate data around the world—all in a unified data fabric." So, if I'm expecting a burst of traffic, do I have to "change my infrastructure footprint" manually? How quickly can one "elastically add capacity"? I mean, I've seen plenty of systems that one can add capacity to that, well, get humbled when copying data to new nodes. Like, you had 10 nodes and now you want 15 because you're being hammered. And wonderful, it's trying to copy data to the new nodes while it was already having capacity issues and only making response times worse and errors go up. I'm not saying that will happen to you, but there's no information to make me think that problem is addressed.
Honestly, people involved in FaunaDB seem to know enough about databases that I'd just expect more real information on the website. When Kudu came out, they published a paper that basically read like, "well, we created a column store kinda like one would if you'd read the C-Store paper and these are the trade-offs and we seem to have done reasonably" and I came away from reading it thinking, "ok, these people know the score. It may or may not be executed well enough, but there's an understanding." They led with a paper that might not have been revolutionary, but really showed that they understood the space and explained how it was designed such that someone with databases knowledge could see that it was reasonable.
Introducing your database with so much, well, non-information doesn't help you (in my opinion). Without digging, it looks like another DB vendor that promises everything will be perfect and that it's great for any workload.
The whole "About FaunaDB" page doesn't tell me much. Like, there's a comment in here that tells me you're using logical clocks, I can see from Daniel's Twitter that you're using some of his research, etc. I mean, you actually have cool technical details to highlight - details that make your DB seem a lot more real. But the page makes it feel like you don't have cool technical details - that you're trying to hide information because it's not good. I mean, adding in some details about how things are achieved make a product seem a lot more real. I know what logical clocks are. Calvin is a research paper I can read. I mean, finding that makes FaunaDB seem way more real - there's something substantive. Like, I can read Calvin tomorrow and some of the ways you're achieving things will come to light and I might be impressed.
But right now, it's really hard to find the information that would impress technical readers.
Both Spanner and Datastore do quite well in the cloud for "huge scale" as fully managed services. And with any deployment on-premise, one certainly must manage their own capacity "by hand".
(work at Google Cloud)
I understand that we are talking about a globally distributed, serverless and yet consistent relational database.
My question is about latency. How long does it take for transactional atomicity to become a consistent read on a globally distributed database? (1) And what are the measures taken between entry nodes to prevent clients from recieving inconsistent data? (2)
As I ponder this, I am struck by not the consistency problem, as that is solvable. But I am struck by the latency problem of assuring that all global queries are consistent for some (any) time quanta. What sort of latency should be expected?
both questions (1) and (2) are interesting, but (1) is critical while (2) is academic.
Thanks, and very interesting work guys.
EL
In short, writes require a global round-trip through the transaction pipeline; reads are local and low latency.
Is this correct?
EL
And yes, for reads, by default the coordinating node chooses a timestamp and uses that to query all involved data partitions. Each partition will respond with the requested data as of at that timestamp, or will delay responding until it has caught up.
One nice thing about this approach is that any chosen timestamp is enough to provide a consistent snapshot view of the dataset at that time. This ends up being useful for bulk or incremental reads, where a longer running process needs a stable view of the dataset.
Question #2 -- Two, or Three, or More transactions occur simultaneously that want to change data D. each of these transactions send out transaction logs that contradict each other. What happens?
EL
Edit: I misread it. Perhaps instead of inventing your own point system that you have to explain and hope silly people (like me) don't mix up you could take a lesson from Google Cloud and just lay out the pricing in a table. If you ever add another service you'll have to integrate it also into your made up points system.
I see Fauna has temporal queries, but receiving events is strictly pull, there is no push or single feed?
I'm working on a follow up example to this CRUD one, that implements a multi-user TodoMVC, and will use event queries to keep the UI updated between tabs and users. You can see the basic Serverless CRUD starter example here: https://fauna.com/blog/serverless-cloud-database
[1] https://fauna.com/blog/escape-the-cloud-database-trap-with-s...
[2] https://news.ycombinator.com/item?id=13877223
[3] https://serverless.com/blog/faunadb-serverless-authenticatio...
Personally I'm more interested in helping people writing fresh apps use FaunaDB, because while we can solve enterprise problems at scale, it's the greenfield apps that will be able to best use our advanced features.
[0] http://finance.yahoo.com/news/fauna-launches-faunadb-serverl...
One way to handle it when something strikes you as not correct is to politely ask for clarification.
Their claim is that you can run an application distributed in a cloud around the world with data in their database, and read queries to their database will get results in an average of 2.8 ms.
This puts a lot of caveats on that 2.8 ms claim, and makes it something that is both good and believable. Which makes the claim very much not bullshit.
It's not really a full answer, but maybe hints at the architecture.
Data stored "on the wire"? :D
It merely remains to turn this into a startup.
pingfs - Stores your data in ICMP ping packets
https://github.com/yarrick/pingfs
https://news.ycombinator.com/item?id=9844725
There should be a Rule 34 for insane software ideas :)
So unless you have some quantity discounts, that would seem to be the price for storing 1 PB , without any querying.
We have a blog post by Daniel Abadi coming as well about the consistency model.
I've learned to not believe that distributed software will work in practice in the way that its authors claim it will. The stronger the claims, the more important it is to have an independent test validating it before I even think of trusting it.
For what it's worth, we have built high-performance distributed systems before....so it's not just wishful thinking.
As a proprietary service, you are now competing against Cloud Spanner which (while people love the underdog) means your toast because they have Eric Brewer to hand wave away their marketing lingo.
On the flip side, you are competing against Cockroach, but they are Open Source so that puts you in a rock and a hard place. From previous comments of mine, you may know I don't think Cockroach has much of a future either because Globally Consistent databases aren't going to cater to the necessary P2P future of the web (5B+ new people coming online, 100B+ IoT devices, graph enabled social web, Machine Learning, etc. which is what we, http://gun.js.org/ , caters to and we just successfully ran load tests on low end hardware doing 1.7K table inserts/sec across a federated system, we plan on getting this up to 10K inserts/second on cheap [if not free] hardware).
Why are these systems going to fail to pick up the market? Because the best of the best, both in engineering and as an Open Source community, RethinkDB (which I praise highly) couldn't. At the end of the day, the few companies that need globally consistent transactions will trust (for better or for worse) Cloud Spanner, and the others who want to roll their own infrastructure will try Cockroach but ultimately switch to RethinkDB in the end.
So on that note, as others have noted, don't use your /fantastic/ marketing opportunities (top of HN) to make false claims about being "industry first", it won't help you gather a developer community. Use this time to win developers over like Firebase did (which itself now has their community scared of when/if Google will shut them down, those developers are now flooding to RethinkDB and ours, despite Firebase being one of the best - high praise for them as well, like Rethink).
Well, that's an interesting assertion. Why do you think that?
Those systems are largely highly localized, and so /strong eventual consistency/ is more important than globally consistent blocking operations.
Also, again with 5B+ people coming online, Master-Slave systems (even distributed ones) still have a huge bottleneck already in the present day. P2P systems (master-master) will scale better in these settings.
I think there's an assumption here that most of the responsibility for storing the source of truth will move out to things like IoT devices (i.e. fog computing).
And sure, there will probably be a need for that. But regarding the assumption that most web services will go away, I don't there's sufficient evidence to bet on it happening anytime reasonably soon. Data centers and public clouds will probably still be there in the next decade or two.
I ask this as a long-time user of RethinkDB.
(1) RethinkDB got good reviews/patches on the Jepsen tests, the recent Cockroach review wasn't as successful (although I'm sure they'll get patches and performance up).
(2) The convenience of the realtime updates and developer community friendliness is going to win over (from a social perspective) the types of startups/teams that choose to roll their own not-locked-in all-open-source infrastructures that they deploy to clouds.
I'm pretty strongly opinionated on these things, I think Firebase and RethinkDB nailed it, and other contenders (in those spaces, whether a Master-Slave service or open source one) have hard fighting battles.
2. I've been using RethinkDB for years and I've never found a use for the realtime updates. I think the benefit of that is mostly limited to chat apps, realtime collaboration, etc.