28 ms·
Introducing Cloud Spanner, a Global Database Service
- kozak 10y agoI wonder how many people will get a seizure from that red-blue blinking rectangle in the video :( Upd: Downvoting this warning will only increase that number.
- jallriddle 10y agoIs this similar to AWS Aurora or is this something else completely different?
- agwa 10y agoAurora is not globally distributed. Spanner is, and is based on Google research which takes advantage of atomic clocks installed in each server: https://research.google.com/archive/spanner-osdi2012.pdf https://research.google.com/archive/spanner-osdi2012.pdf Edit: not every server has an atomic clock; see replies by Google employees
- deleted 10y ago[deleted]
- Scaevolus 10y agoThere are only atomic clocks in some master servers: "TrueTime is implemented by a set of time master machines per datacenter and a timeslave daemon per machine. The majority of masters have GPS receivers with dedicated antennas; these masters are separated physically to reduce the effects of antenna failures, radio interference, and spoofing. The remaining masters (which we refer to as Armageddon masters) are equipped with atomic clocks. An atomic clock is not that expensive: the cost of an Armageddon master is of the same order as that of a GPS master." The timeslave daemons running on each machine keep them synchronized with the master time servers, and maintain tight bounds on their inaccuracy. (Disclaimer: I work at Google)
- boulos 10y agoEach datacenter not server :).
- deleted 10y ago[deleted]
- darkerside 10y ago> Unlike most wide-area networks, and especially the public internet, Google controls the entire network and thus can ensure redundancy of hardware and paths, and can also control upgrades and operations in general I know this is a single system, but I'll still say it. This seems like another step in a scary trend for our internet.
- runeks 10y agoWhy is it a scary trend that Google has made their part of the internet more resilient?
- ihsw 10y agoThe parent comment author seems to be disturbed by the phrase "controls the entire network." Setting aside his unwarranted paranoia, it does make me wonder which organization has the largest and most reliable corner of the internet. Google certainly qualifies by sheer volume of hardware and network infra.
- aanm1988 10y agobecause we keep giving up more and more control to a single Ad company.
- manacit 10y agoThis is no different from a myriad of other companies that have private networks on private fiber that span large geographical paths. Google's is probably bigger than most (both in terms of geography and throughput), but it's nothing new to have private fiber to ensure latency/throughput/reliability.
- theDoug 10y agoI am an employee, and have my biases, but I’ll always prefer a customer's data stay on our backbone and not be passed through the public internet. Our customers also prefer it, and it's not something other Cloud providers can fully cover.
- 10y ago
- koolba 10y ago> Today, we’re excited to announce the public beta for Cloud Spanner, a globally distributed relational database service that lets customers have their cake and eat it too: ACID transactions and SQL semantics, without giving up horizontal scaling and high availability. This is a bold claim. What do they know about the CAP theorem that I don't? Separately, (emphasis mine): > If you have a MySQL or PostgreSQL system that's bursting at the seams, or are struggling with hand-rolled transactions on top of an eventually-consistent database, Cloud Spanner could be the solution you're looking for. Visit the Cloud Spanner page to learn more and get started building applications on our next-generation database service. From the rest of the article it seems like the wire protocol for accessing it is MySQL. I wonder if they mean to add a PostgreSQL compatibility layer at some point.
- teraflop 10y ago"High availability" is not the same thing as the "A" in the CAP theorem. Spanner chooses consistency over availability, but it is a HA system in the sense that it can tolerate datacenter outages.
- dsp1234 10y agoWhat do they know about the CAP theorem that I don't? I don't know your expertise on the subject, but they do have a post on this topic. Some highlights: "Does this mean that Spanner is a CA system as defined by CAP? The short answer is “no” technically, but “yes” in effect and its users can and do assume CA." "The purist answer is “no” because partitions can happen and in fact have happened at Google, and during some partitions, Spanner chooses C and forfeits A. It is technically a CP system." https://cloudplatform.googleblog.com/2017/02/inside-Cloud-Spanner-and-the-CAP-Theorem.html https://cloudplatform.googleblog.com/2017/02/inside-Cloud-Sp...
- deleted 10y ago[deleted]
- larsiusprime 10y ago> What do they know about the CAP theorem that I don't? Their statement, for what it's worth: https://cloudplatform.googleblog.com/2017/02/inside-Cloud-Spanner-and-the-CAP-Theorem.html https://cloudplatform.googleblog.com/2017/02/inside-Cloud-Sp...
- bowmessage 10y agoInteresting reading: Spanner Whitepaper https://cloud.google.com/spanner/docs/whitepapers/SpannerAndCap.pdf https://cloud.google.com/spanner/docs/whitepapers/SpannerAnd...
- andy_ppp 10y ago> clients can do globally consistent reads across the entire database without locking How is this possible across data centres? Does it send data everywhere at once? Seems too good to be true of course but if it works and scales it might be worthwhile just not having to worry about your database scaling? Still I don't believe it ;-) EDIT: further info... > Spanner mitigates this by having each member be a Paxos group, thus ensuring each 2PC “member” is highly available even if some of its Paxos participants are down. Data is divided into groups that form the basic unit of placement and replication. So it's SQL with Paxos that presumably never get's confused but during a partition will presumably not be consistent.
- jdcarr 10y ago> In terms of CAP, Spanner claims to be both consistent and highly available despite operating over a wide area, which many find surprising or even unlikely. The claim thus merits some discussion. Does this mean that Spanner is a CA system as defined by CAP? The short answer is “no” technically, but “yes” in effect and its users can and do assume CA. The purist answer is “no” because partitions can happen and in fact have happened at Google, and during some partitions, Spanner chooses C and forfeits A. It is technically a CP system.
- jhugg 10y agoI would expect more from Brewer. "CA except when there are partitions" is CP. It's not "effectively CA".
- xapata 10y agoNo, he's saying it's effectively CAP because the A downtime is so small. It's one thing to do that for a key-value store. Entirely another to support joins on a globally distributed database. This ain't just one availability zone. Spanner is amazing. It took them a few years to make it a service, but when they announced its use internally a few years ago, it seemed like the nail in the coffin for in-house database hosting.
- cipherzero 10y agoThe white paper is available here: http://static.googleusercontent.com/media/research.google.com/en/us/archive/spanner-osdi2012.pdf http://static.googleusercontent.com/media/research.google.co... for anyone interested
- cipherzero 10y agoOh and the newer white paper from today: https://cloud.google.com/spanner/docs/whitepapers/SpannerAndCap.pdf https://cloud.google.com/spanner/docs/whitepapers/SpannerAnd...
- amaks 10y agoI bet there will be a lot about CAP theorem in the comments:-)
- runeks 10y agoI wonder why they charge a minimum of $0.90 per node-hour when they offer VMs for as little as $0.008/hr. This is hugely useful even for single-person startups, so why charge a minimum of ~$8,000 per year?
- brangalina4eva 10y agoBecause it's highly innovative. Cost != value.
- theDoug 10y agoHugely useful but also hugely different from an engineering/coverage perspective, perhaps. Companies with more data than can fit in a single-instance RDBMS system (like >3TB of hot data, more throughput than a single node can handle) but still seeking transactional consistency are a clear use case. Single-person startups could definitely benefit, but it's a less-likely scenario that they would require the level of coverage Spanner provides.
- 010a 10y agoBut the most successful products tend to be ones that can scale from zero to global. DynamoDB is a great example.
- andrewguenther 10y agoWhy should useful things be cheap?
- bradgalina4eva 10y agoIt's innovative. Cost != value.
- otterley 10y agoBecause you're paying not for cost plus, but value added. To make a meaningful cost comparison, the best alternative must be considered, which is you spending your own labor to engineer and build a similar system yourself.
- 10y ago
- jdcarr 10y agoLink to the actual OSDI paper (not the simpler whitepaper) https://static.googleusercontent.com/media/research.google.com/en//archive/spanner-osdi2012.pdf https://static.googleusercontent.com/media/research.google.c...
- tdrd 10y agoDoesn't seem possible to use this yet. No client libraries and no samples: https://cloud.google.com/spanner/docs/tutorials https://cloud.google.com/spanner/docs/tutorials Have they documented the wire protocol? I couldn't find it.
- deleted 10y ago[deleted]
- mairbek 10y agoI work on Cloud Spanner and client libraries are rolling out right now, but API definitions are available. RPC: https://cloud.google.com/spanner/docs/reference/rpc/ https://cloud.google.com/spanner/docs/reference/rpc/ Rest: https://cloud.google.com/spanner/docs/reference/rest/ https://cloud.google.com/spanner/docs/reference/rest/
- michaelsbradley 10y agoAnyone working on a Rust lang client-library?
- justinblat 10y agoWe're still working on rolling a few docs throughout the day. For example - here's the node.js lib: https://github.com/GoogleCloudPlatform/google-cloud-node#cloud-spanner-alpha https://github.com/GoogleCloudPlatform/google-cloud-node#clo...
- api 10y agoGiven the CAP theorem I wonder what trade-offs they make and how much visibility they give you into these trade-offs. In any case this is much better than Amazon's offerings... when they actually ship it. :)
- jrowley 10y agoCheck out this post mentioned in the original post: https://cloudplatform.googleblog.com/2017/02/inside-Cloud-Spanner-and-the-CAP-Theorem.html https://cloudplatform.googleblog.com/2017/02/inside-Cloud-Sp... Of note: They say Spanner is "both consistent and highly available despite operating over a wide area". So not 100% availability but they've got it to "more than five 9s of availability (less than one failure in 1066)."
- mikeyouse 10y agoI didn't pick up on it until just a moment ago, but when you say "They say", it's actually Eric Brewer saying that -- who's most known for coming up with the CAP theorem. I think they've got a pretty good understanding of it!
- jrowley 10y agoha whoops good catch! I knew the post was written by Brewer, but slipped up with the they... yeah I think we have it on pretty good authority that they system doesn't so how violate CAP yet addresses it's challenges.
- tedd4u 10y agoThe team here at Quizlet did a lot of performance testing on Spanner with one of our MySQL workloads to see if it's an option for us. Here are the test results: https://quizlet.com/blog/quizlet-cloud-spanner https://quizlet.com/blog/quizlet-cloud-spanner
- koolba 10y agoWhat's the SQL and wire compatibility level? MySQL? EDIT: Found quite a bit of my answers in your linked article: > Cloud Spanner uses a SQL dialect which matches the ANSI SQL:2011 standard with some extensions for Spanner-specific features. This is a SQL standard simpler than that used in non-distributed databases such as vanilla MySQL, but still supports the relational model (e.g. JOINs). It includes data-definition language statements like CREATE TABLE. Spanner supports 7 data types: bool, int64, float64, string, bytes, date, timestamp[20]. > Cloud Spanner doesn't, however, support data manipulation language (DML) statements. DML includes SQL queries like INSERT and UPDATE. Instead, Spanner's interface definition includes RPCs for mutating rows given their primary key[21]. This is a bit annoying. You would expect a fully-featured SQL database to include DML statements. Even if you don't use DML in your application you'll almost certainly want them for one-off queries you run in a query console. > Though Cloud Spanner supports a smaller set of SQL than many other relational databases, its dialect is well-documented and fits our use case well. Our requirements for a MySQL replacement are that it supports secondary indices and common SQL aggregations, such as the GROUP BY clause. We've eliminated most of the joins we do, so we haven't tested Cloud Spanner's join performance. This seems like it'd prevent any kind of easy switch over to Spanner.
- havermeyer 10y agoIt has the same basis as standard SQL in BigQuery: https://cloud.google.com/bigquery/docs/reference/standard-sql/ https://cloud.google.com/bigquery/docs/reference/standard-sq...
- saycheese 10y agoSeems more like they want all the data that ever existed for the database.
- gigatexal 10y agoThe sql syntax reference looks similar to that of Postgres' syntax reference.
- advisedwang 10y agoActually it is most closely related to the new ["Standard SQL" in BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/ https://cloud.google.com/bigquery/docs/reference/standard-sq...).
- karlding 10y agoI wonder how this will affect adoption of CockroachDB [1], which was inspired by Spanner and supposedly an open source equivalent. I'd imagine that Spanner is a rather compelling choice, since they don't have to host it themselves. As far as I know, CockroachDB currently does not support providing CockroachDB as a service (but it is on their roadmap) [2]. [1] https://www.cockroachlabs.com/docs/frequently-asked-questions.html https://www.cockroachlabs.com/docs/frequently-asked-question... [2] https://www.cockroachlabs.com/docs/frequently-asked-questions.html#does-cockroach-labs-offer-a-cloud-database-as-a-service https://www.cockroachlabs.com/docs/frequently-asked-question...
- obstinate 10y agoI imagine the globally distributed database market is big enough for more than one winner. The presence of competitors can sometimes even be a boon, increasing the visibility of a market's goods relative to other similar goods.
- rrdharan 10y agoAnd assuming some reasonable compatibility/portability/migration story it can help in reducing the rational fear of proprietary lock-in.
- tazjin 10y agoThe main sales pitch of Cloud Spanner is Google's network infrastructure. No startup will be able to replicate that anytime soon, a lot of time (and money) has been put into it by a lot of people over a long time.
- scarmig 10y agoCurious: is there any company in the world that could replicate its breadth, performance, and reliability in the next decade? Could any government? Has any government? My impression is that, infrastructure wise, Google is genuinely in a class of size one.
- pagade 10y agoWhat is TrueTime really? Are their Distributed Systems 'sharing a global clock'?
- amaks 10y agoHere is a good article: http://www.bluetreble.com/2015/10/time-travel/ http://www.bluetreble.com/2015/10/time-travel/
- philip1209 10y agoFrom the Spanner paper: > The underlying time references used by TrueTime are GPS and atomic clocks. TrueTime uses two forms of time reference because they have different failure modes... TrueTime is implemented by a set of time master machines per datacenter and a timeslave daemon per machine. The majority of masters have GPS receivers with dedicated antennas; these masters are separated physically to reduce the effects of [GPS] antenna failures, radio interference, and spoofing. The remaining masters (which we refer to as Armageddon masters) are equipped with atomic clocks. An atomic clock is not that expensive: the cost of an Armageddon master is of the same order as that of a GPS master. Source: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/39966.pdf https://static.googleusercontent.com/media/research.google.c...
- fintler 10y agoHere's a very rough (and non-practical due to the large time error) implementation of TrueTime that I wrote a while back that uses the regular linux apis: https://stackoverflow.com/questions/18384883/why-is-googles-truetime-api-hard-to-duplicate https://stackoverflow.com/questions/18384883/why-is-googles-... I suppose if you spent some serious effort with ntpd (maybe hook it up to a PCI ClockCard), you could get this approach to work.
- dhd415 10y agoGiven that CockrochDB is based on Spanner and F1, this DBaaS sounds like it will compete directly with them.
- assface 10y ago> Given that CockrochDB is based on Spanner and F1, this DBaaS sounds like it will compete directly with them. Except that it's not. CockroachDB uses MVCC. Spanner uses 2PL and F1 uses OCC. Not the same at all.
- Ajedi32 10y ago> Today, we’re excited to announce the public beta for Cloud Spanner, a globally distributed relational database service that lets customers have their cake and eat it too: ACID transactions and SQL semantics, without giving up horizontal scaling and high availability. This sounds too good to be true. But it's Google, so maybe not. Time to start reading whitepapers...
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- executive 10y agoDoes it support spatial objects / can it replace PostGIS?
- brightsize 10y agoNo. https://cloud.google.com/spanner/docs/data-types https://cloud.google.com/spanner/docs/data-types
- rdtsc 10y ago> This leads to three kinds of systems: CA, CP and AP, What is a distributed system that is CA? Can you build a distributed system which will never have a partition.
- halflings 10y agoThey answer your question just two lines under the one you are quoting: > For distributed systems over a “wide area,” it's generally viewed that partitions are inevitable, although not necessarily common. If you believe that partitions are inevitable, any distributed system must be prepared to forfeit either consistency (AP) or availability (CP), which is not a choice anyone wants to make. In fact, the original point of the CAP theorem was to get designers to take this tradeoff seriously. But there are two important caveats: First, you only need to forfeit consistency or availability during an actual partition, and even then there are many mitigations. Second, the actual theorem is about 100% availability; a more interesting discussion is about the tradeoffs involved to achieve realistic high availability.
- rdtsc 10y ago> If you believe that partitions are inevitable, any distributed system How does that answer it? Are they implying that partitions will not happen if you don't believe in them?
- robryk 10y agoA CA system is not a system that doesn't have partitions, it's a system that works under the condition that there are no partitions (ie. it is a non-partition-resistant system).
- sudhirj 10y agoA memcache cluster might qualify. If there's a partition, just forget about the missing nodes. It's just a cache anyway.
- xapata 10y agoAmazon likes to respond to Google with it's own price drops and product launches. It's telling that their announcements are orthogonal instead of direct competition with Spanner. When Google announced Spanner back in 2012, I'm sure Amazon and Microsoft started teams to reproduce their own versions. Spanner is not just software. The private network reduces partitions. GPS and atomic clocks for every machine help synchronize time globally. There won't be a Hadoop equivalent for Spanner, unless it includes the hardware spec.
- elvinyung 10y agoAmazon already has Aurora: https://aws.amazon.com/rds/aurora/details/ https://aws.amazon.com/rds/aurora/details/ You're right that there's literally nothing else out there that has tight synchronization using atomic clocks, though.
- xapata 10y agoAnd because of that, Aurora's multi-zone replicas are read-only. I just noticed Google says the cross-region feature is coming later in 2017. Amazon might be planning to announce a similar change for Aurora in the coming months.
- user5994461 10y agoAurora is a toy compared to Spanner. Single region, limited backups and replication topologies, limited performances. There is yet to see if Spanner can achieve the expectations, if it does, it's a game changer.
- xapata 10y ago> achieve the expectations It has for Google internally. No reason why they can't share the service externally.
- discodave 10y agoActually, there are lots of reasons why it's hard to share a service externally. Making a service public means you have to deal with lots of new problems like billing, abuse, dealing with lots of small users instead of a few large ones, stronger backwards compatibility requirements and so-forth.
- rattray 10y agoVery interesting. How does this pricing compare to AWS Aurora? https://aws.amazon.com/rds/aurora/pricing/ https://aws.amazon.com/rds/aurora/pricing/
- ryeguy 10y agoIt's not fair to compare these since Aurora is a traditional relational database. It does not have a horizontal scalability solution aside from read replicas.
- tedd4u 10y agoNot sure. If you need to scale beyond a single master, Aurora won't help in the same way Spanner does though. You can dial up the number of nodes in Spanner dynamically under load with good results.
- suprgeek 10y agoReally a CP system but with the Availability being five 9s or better (less than one failure in 10^6) How: 1)Hardware - Gobs and Gobs of Hardware and SRE experience "Spanner is not running over the public Internet — in fact, every Spanner packet flows only over Google-controlled routers and links (excluding any edge links to remote clients). Furthermore, each data center typically has at least three independent fibers connecting it to the private global network, thus ensuring path diversity for every pair of data centers. Similarly, there is redundancy of equipment and paths within a datacenter. Thus normally catastrophic events, such as cut fiber lines, do not lead to partitions or to outages." 2) Ninja 2PC "Spanner uses two-phase commit (2PC) and strict two-phase locking to ensure isolation and strong consistency. 2PC has been called the “anti-availability” protocol [Hel16] because all members must be up for it to work. Spanner mitigates this by having each member be a Paxos group, thus ensuring each 2PC “member” is highly available even if some of its Paxos participants are down."
- jpmattia 10y ago> with the Availability being five 9s or better (less than one failure in 10^6) Anyone know how exactly this is defined for them? (Time? Queries? Results?)
- bpicolo 10y agoLooks like they define it as "downtime where downtime instance > 30s"?
- btian 10y agoIn general availability is defined in terms of time. https://en.wikipedia.org/wiki/High_availability https://en.wikipedia.org/wiki/High_availability Five-9s means 5 minutes of downtime per year.
- the_cap_theorem 10y agoWell, this is what the spanner website says if you read the fine print: >> This feature is not covered by any SLA So I would guess that you don't get _any_ guarantess. Not five nines and not even one nine.
- ChuckMcM 10y agoCongratulations to the Spanner team for becoming part of the Google public cloud! And for those wondering, this is why Oracle wants billions of dollars from Google for "Java Copyright Infringement" because the only growth market for Oracle right now is their hosted database service, and whoops Google has a better one now. It will be interesting if Amazon and Microsoft choose to compete with Google on this service. If we get to the point where you have databases, compute, storage, and connectivity services from those three at equal scale, well that would be a lot of choice for the developers!
- snikch 10y agoAmazon's Aurora databases seem to be solving the same problem, and are MySQL or Postgres compatible to boot.
- deleted 10y ago[deleted]
- manacit 10y agoAurora is a 'better MySQL mousetrap', IMO. This is a globally-available, nearly-CAP-beating datastore that powers one of the biggest websites on the internet. It's not quite apples and oranges, but this is definitely a different problem they are solving.
- abalone 10y agoThat's vague. AWS also powers huge websites and Amazon is recommending Aurora as the "default choice" for most workloads.[1] There are certainly significant architectural differences but I would say we can definitely make a direct practical comparison. [1] http://www.computerworld.com/article/2953299/cloud-computing/amazon-takes-on-mysql-with-aurora.html http://www.computerworld.com/article/2953299/cloud-computing...
- cobookman 10y agoIf Aurora powers huge websites, spanner is for ginormous websites. Think a multiplier to netflix's database needs.
- elvinyung 10y agoWhile everyone is puzzling over how Spanner seems to be claiming to be CA, I would like to take this opportunity to bring up PACELC[1]. The idea is that the A-or-C choice in CAP only applies during network partitions, so it's not sufficient to describe a distributed system as either CP or AP. When the network is fine, the choice is between low latency and consistency. In the case of Spanner, it chooses consistency over availability during network partitions, and consistency over low latency in the absence of partitions. 1: http://cs-www.cs.yale.edu/homes/dna/papers/abadi-pacelc.pdf http://cs-www.cs.yale.edu/homes/dna/papers/abadi-pacelc.pdf
- meddlepal 10y agoIt's not claiming CA. It's claiming CP with A strongly implied thanks to a massive amount of Google engineering and private networking. https://cloudplatform.googleblog.com/2017/02/inside-Cloud-Spanner-and-the-CAP-Theorem.html https://cloudplatform.googleblog.com/2017/02/inside-Cloud-Sp...
- deleted 10y ago[deleted]
- kennethmac2000 10y agoLooks cool, but the pricing seems a bit non-cloud-native (or at least non-GCP-native). "You are charged each hour for the maximum number of nodes that exist during that hour." We've been educated by Google to consider per-minute, per-instance/node billing normal - and presumably all the arguments about why this is the right, pro-customer way to price GCE apply equally to Cloud Spanner.
- advisedwang 10y agoThe per-minute billing is an advantage when you are scaling up and down rapidly. If you use VMs just for 5 minutes, per minute pricing is 20x cheaper than hourly billing. However with a database it is rare to scale up and down rapidly. Rather you expect change over the order of days. Imagine you go from 10 instance to 15 instances over a week. per minute billing only saves a possible 5 instance-hours over the week compared to hourly billing, which is less than 1% saving.
- emersonrsantos 10y agoThomas Watson in 1943 amd his famous quote: “I think there is a world market for about five computers". If he was alive, he could say these computers are Google, Apple, Microsoft, Amazon and Facebook.
- jonstokes 10y agoI beat you by 7 years :) https://arstechnica.com/civis/viewtopic.php?f=21&t=1109206 https://arstechnica.com/civis/viewtopic.php?f=21&t=1109206
- emersonrsantos 10y agoYou win :D
- abalone 10y agoHow does this compare to AWS Aurora in terms of pricing and performance? With Aurora the basic instance is $48/month and they recommend at least two in separate zones for availability, so it's about $96/month minimum. Storage is $.10/GB and IO is $.20 per million requests. Data transfer starts at $.09/GB and the first GB is free.[1] Spanner is a minimum of $650/mo (6X the Aurora minimum), storage is $.30/GB (3X), and data transfer starts at $.12/GB (1.3X). Of course with Aurora you have to pick your instance size and bigger faster instances will cost more. Also there's the matter of multi-region replication, although it appears that aspect of Spanner is not priced out yet. So maybe as you scale the gap narrows, but it's interesting to price out the entry point for startups. [1] https://aws.amazon.com/rds/aurora/ https://aws.amazon.com/rds/aurora/
- jedberg 10y agoThis release shows the different philosophies of Google vs Amazon in an interesting way. Google prefers building advanced systems that let you do things "the old way" but making them horizontally scalable. Amazon prefers to acknowledge that network partitions exist and try to get you to do things "the new way" that deals with that failure case in the software instead of trying to hide it. I'm not saying either system is better than the other, but doing it Google's way is certainly easier for Enterprises that want to make the move, and why Amazon is starting to break with tradition and release products that let you do things "the old way" while hiding the details in an abstraction. I've always said that Google is technically better than AWS, but no one will ever know because they don't have a strong sales team to go and show people. This release only solidifies that point.
- hueving 10y ago>and release products that let you do things "the old way" while hiding the details in an abstraction. However, by 'abstracting' this away, you're not being forced to think about failure domains. If there is ever a massive country-wide connectivity break to the wider Internet (feasible for lots of people inside censored countries), you'll be pretty pissed when you can't use the DB services for your servers in the Google-local datacenter that you still have connectivity to because it can't get quorum.
- jedberg 10y agoExactly my point. I would say I personally prefer the Amazon way of forcing you to think about these things.
- boulos 10y agoI'd encourage you to read the F1 paper and the Spanner paper if you haven't already. The big thing that stood out to me is that Google started that way (with BigTable) where you'd roll your own availability and transactions. It didn't go well. That's the motivation behind both Spanner and F1: take the experience of how painful it is to do transactions on a Regional or Global level, and never make individual teams do it again. I see it a bit like "Don't roll your own crypto". Clearly some people are exempted from it, but you better be able to tell me why you get an exception. Disclosure: I work on Google Cloud and want you to pay for Spanner :).
- williamle8300 10y agoI see there's "data layer encryption" but the data is still readable by Google. Why would anyone want to keep feeding the Google beast with more data? Software is about separating concerns, and decentralizing authority. Responsible engineers shouldn't be using this service.
- dorianm 10y agoSpanner's paper: https://static.googleusercontent.com/media/research.google.com/en//archive/spanner-osdi2012.pdf https://static.googleusercontent.com/media/research.google.c...
- sudhirj 10y agoFor those trying to compare this with AWS Aurora, Aurora is more a regular database (MySQL / Postgres) engine with a custom data storage plugin that's AWS/ELB/SSD/EFS-aware. Because of this the database engine can make AWS specific decisions and optimizations that greatly boost performance. It supports master-master replication in the same region, master-slave across regions. Global Spanner looks like a different beast, though. It looks like Google has configured a database for master-master(-master?) replication, across regions and even continents. They seem to be pulling it off by running only their own fiber, each master being a paxos cluster itself, GPS, atomic clocks and lot of other whiz-bangery.
- sudhirj 10y agoFrom the technical blog post > Does this mean that Spanner is a CA system as defined by CAP? The short answer is “no” technically, but “yes” in effect and its users can and do assume CA. The purist answer is “no” because partitions can happen and in fact have happened at Google, and during some partitions, Spanner chooses C and forfeits A. It is technically a CP system. However, no system provides 100% availability, so the pragmatic question is whether or not Spanner delivers availability that is so high that most users don't worry about its outages. For example, given there are many sources of outages for an application, if Spanner is an insignificant contributor to its downtime, then users are correct to not worry about it. Basically, the underlying system is CP, but A is so high (because of the custom fiber, paxos etc) that they're rounding it off to 100% and calling it CAP.
- zzzcpan 10y agoExcept that A in CAP has nothing to do with overall system's availability over time and using it as such is just confusing.
- sudhirj 10y agoBut it makes sense in this case. The system guarantees CP. But as customer it looks like you're getting CA as well, because A is so high. If you drink the kool-aid, you get C & A & P. The kool-aid isn't too bad, though if they can measurably guarantee A > 99.999999%, I'm happy to round off to 100% and call it CAP.
- BinaryIdiot 10y agoOh this looks really compelling! Though I'm guessing this is targeted to companies? I'd love to use this for some personal projects but the pricing seems really high. Am I reading it right that a single node being used at least a tiny bit every hour is about $670 a month? Maybe I'm misunderstanding how the pricing works here. Any clarification would be highly welcomed :)
- advisedwang 10y agoIt's targeted to large datasets more than companies. There isn't really any advantage of a single node Cloud Spanner instance over Cloud SQL. Cloud Spanner becomes worthwhile when you have more data/throughput than a single node system can support, at which point the pricing is competitive with other options.
- BinaryIdiot 10y agoFair enough. I just kinda wanted to play with it on my next project :)
- kozikow 10y agoSqlAlchemy engine please :) ?
- tamalsaha001 10y agoOne thing to note is Spanner's transactions are different compared to what you get with a traditional RDBMS. See https://cloud.google.com/spanner/docs/transactions#ro_transaction_example https://cloud.google.com/spanner/docs/transactions#ro_transa... An example is the rows you get back from a query like "select * from T where x=a" can't be part of a RW transaction. I believe because they don't have the time-stamp associated with them. So, you have to re-read those rows via primary key inside a RW transaction to update them. This can be a surprise if you are coming from a traditional RDBMS background. If you are think about porting your app from MySQL/PostgreSQL to Spanner, it will be more than just updating query syntax. Disclaimer: I used F1 (built on top of Spanner, https://research.google.com/pubs/pub41344.html https://research.google.com/pubs/pub41344.html) few years ago.
- sandGorgon 10y ago> If you have a MySQL or PostgreSQL system that's bursting at the seams Postgresql ? How does this work for people migrating from traditional SQL databases - typically people use ORM. How would this fit in with, say , Rails or SqlAlchemy ?
- boulos 10y agoThere is JDBC support, so if you're willing and able to connect that way, you could hope for an easier migration. Any move from one database to another is a migration, even if only to deal with dialect-specific things. Disclosure: I work on Google Cloud (but not Spanner).
- deesix 10y agoThere is real work to migrate you application to use Cloud Spanner. Your schemas and queries will work with some tweaking but we don't have ORM support at beta. We are going to produce some additional collateral on migrating from popular RDBMS, but the Quizlet post is the best reference right now for migrating from MySQL. https://quizlet.com/blog/quizlet-cloud-spanner https://quizlet.com/blog/quizlet-cloud-spanner We have released client libraries for Java, Go, Node and Python on Github, but we haven't used those clients to implement support for popular ORMs. Basically, the open-source ecosystem will need to add support for these ORMs but we will contribute wherever we can to push these initiatives. If we get lots of demand for a specific ORM, we will look into doing something special for that. Hope that helps. (disclaimer: I work on Cloud Spanner)
- tabeth 10y agoForgive my ignorance, but could someone explain in layman's terms in which situation this would be helpful? E.g. if I have 1TB of data would I use this? If I have 1GB with a growth rate of 25GB/daily would I use this?
- biot 10y agoYou may benefit from something like this if you do an analysis of your DB usage/growth patterns and determine that server/cluster scalability is going to be a non-trivial concern in the near future. Volume of data doesn't matter (to a certain point) if you seldom query that data. 1000TB of data that is neither queried nor updated doesn't require a database at all, for example. So, as with all things engineering, it depends. You know you'll benefit from it if you can demonstrate that you'll benefit from it an that the effort/risk/etc. is lower than some other solution you could choose. If you're unable to determine this, you should bring in an expert who can.
- mdolan 10y agoThe rule of thumb I have always been told is that you can push MySql to ~200 GB total and between 99.9% and 99.99% availability (between 1 and 9 hours of downtime per year). Your milage might vary, but these are probably the right orders of magnitude. There is also an iops limit but that's harder to put a clear limit on because it's workload dependent. If you need more storage, availability, or iops, the current recommendations are shared relational stored or NoSql. Sharding relational databases means instead of turning on 1 MySql machine, you turn on 16 MySql machines and store 1/16th of the data on each machine. It only allow queries patterns that can be responded to by a single shard (so if you are only doing queries on a per user basis, your golden, otherwise, not so much) and require that your hottest shards (e.g. most active users) should only be a few orders of magnitude larger than your coldest (Justin Bieber probably needs his own machines at Twitter because he has so many users). There are ways to get around this, but they are tricky and will require a lot of developer time. With NoSql (riak, cassandra, dynamo, etc.), you have to give up many features that make developers lives easier in order to scale beyond a single machine. Each flavor has it's own set of tradeoffs, but the biggest problem is that you loose (1) committing multiple rows at the same time (atomic commit) and (2) ensuring queries don't overlap (isolation). Spanner offers an alternative where the developer (for the most part) doesn't have to know that her data lives on multiple different machines. It gives you 99.999% availability and theoretically unlimited scaling to any size, with an API that is still relatively developer friendly (compared with NoSql or Shared Sql). One cost here is latency / performance. You need to write to multiple computers across the world so write speed will be bounded at a minimum by the speed of light between those datacenters. Short answer, there are a lot of companies that could benefit from a system like this. It could give higher availability to a small Sql dataset or stronger guarantees to a current large NoSql database. There is even an argument to be made that the majority of problems companies face today are best solved with this type of system and relational or NoSql optimized workloads are the exception, not the rule.
- mankash666 10y agoWhile the product is compelling (acid compliant, horizontally scanning DB), it does seem expensive. If you use 2 nodes/hour, Cost = (20.9) 24 * 31 = $1400/month not anointing for storage and network chargers.
- DivineTraube 10y ago"What if you could have a fully managed database service that's consistent, scales horizontally across data centers and speaks SQL?" Looks like Google forgot to mention one central requirement: latency. This is a hosted version of Spanner and F1. Since both systems are published, we know a lot about their trade-offs: Spanner (see OSDI'12 and TODS'13 papers) evolved from the observation that Megastore guarantees - though useful - come at performance penalty that is prohibitive for some applications. Spanner is a multi-version database system that unlike Megastore (the system behind the Google Cloud Datastore) provides general-purpose transactions. The authors argue: We believe it is better to have application programmers deal with performance problems due to overuse of transactions as bottlenecks arise, rather than always coding around the lack of transactions. Spanner automatically groups data into partitions (tablets) that are synchronously replicated across sites via Paxos and stored in Colossus, the successor of the Google File System (GFS). Transactions in Spanner are based on two-phase locking (2PL) and two-phase commits (2PC) executed over the leaders for each partition involved in the transaction. In order for transactions to be serialized according to their global commit times, Spanner introduces TrueTime, an API for high precision timestamps with uncertainty bounds based on atomic clocks and GPS. Each transaction is assigned a commit timestamp from TrueTime and using the uncertainty bounds, the leader can wait until the transaction is guaranteed to be visible at all sites before releasing locks. This also enables efficient read-only transactions that can read a consistent snapshot for a certain timestamp across all data centers without any locking. F1 (see VLDB'13 paper) builds on Spanner to support SQL-based access for Google's advertising business. To this end, F1 introduces a hierarchical schema based on Protobuf, a rich data encoding format similar to Avro and Thrift. To support both OLTP and OLAP queries, it uses Spanner's abstractions to provide consistent indexing. A lazy protocol for schema changes allows non-blocking schema evolution. Besides pessimistic Spanner transactions, F1 supports optimistic transactions. Each row bears a version timestamp that used at commit time to perform a short-lived pessimistic transaction to validate a transaction's read set. Optimistic transactions in F1 suffer from the abort rate problem of optimistic concurrency control, as the read phase is latency-bound and the commit requires slow, distributed Spanner transactions, increasing the vulnerability window for potential conflicts. While Spanner and F1 are highly influential system designs, they do come at a cost Google does not tell in its marketing: high latency. Consistent geo-replication is expensive even for single operations. Both optimistic and pessimistic transactions even increase these latencies. It will be very interesting to see first benchmarks. My guess is that operation latencies will be in the order of 80-120ms and therefore much slower than what can be achieved on database clusters distributed only over local replicas.
- theptip 10y ago> Does this mean that Spanner is a CA system as defined by CAP? The short answer is “no” technically, but “yes” in effect and its users can and do assume CA. It's somewhat ironic that Brewer, the original author of the CAP theorem, is making this sort of marketing-led bending of the CAP theorem terminology. I think what he really should be saying is something in more nuanced language like this: https://martin.kleppmann.com/2015/05/11/please-stop-calling-databases-cp-or-ap.html https://martin.kleppmann.com/2015/05/11/please-stop-calling-... But perhaps Google's marketing department needed something in the more popular "CP or AP?" terminology. I don't see what would be wrong with "CP with extremely high availability" though. It's certainly wacky to be claiming that a system is "CA", since as the post admits it's technically false; to me this makes it clear that CP vs. AP (vs. CA now?) does not convey enough information. I'd prefer "a linearizably-consistent data store, with ACID semantics, with a 99.999% uptime SLA". Not as snappy as "CA" (I will never have a career in marketing I suppose), but it makes the technical claims more clear.
- wsh91 10y agoYou're omitting what immediately follows: > The purist answer is “no” because partitions can happen and in fact have happened at Google, and during some partitions, Spanner chooses C and forfeits A. It is technically a CP system. > However, no system provides 100% availability, so the pragmatic question is whether or not Spanner delivers availability that is so high that most users don't worry about its outages. For example, given there are many sources of outages for an application, if Spanner is an insignificant contributor to its downtime, then users are correct to not worry about it.
- theptip 10y agoMy point is, why call this "CA", if it's not CA? Especially when you immediately go on to explain why it's not really CA?
- wcdolphin 10y agoIs JSON data type support in the works? Seems to be a very commonly requested feature these days.
- deesix 10y agoYes, it's something we have on the roadmap. We will adjust priority based on the level of demand so thanks for your vote ;-) (disclaimer: I work on Cloud Spanner)
- brandmeyer 10y agoDumb question: Since strings are supported, couldn't you just store some JSON as a string? Or are you talking about supporting queries that involve parsing the JSON on the "server"?
- elvinyung 10y agoYeah, parent probably meant queryable JSON types, a la Postgres[1]. 1: https://www.postgresql.org/docs/9.4/static/datatype-json.html https://www.postgresql.org/docs/9.4/static/datatype-json.htm...
- wcdolphin 10y agoNot dumb, I was being inexact. I was talking about Spanner understanding the semantics of JSON, similar to Postgre's JSONB or MYSQL's JSON.
- seangrogg 10y agoI think the OP was saying "dumb question" as in "I have a dumb question" rather than "this is a dumb question". At least that's the context I inferred.
- khalis411 10y agohow to increase web visitors http://bit.ly/2lHuZ7i http://bit.ly/2lHuZ7i
- nodesocket 10y agoRelated, I wrote a blog post on the network latency between Google Compute Engine zones and regions. I'm assuming Cloud Spanner will still have these latencies once multi-region is deployed. Cross-zone latency on GCE is very good though. https://blog.elasticbyte.net/comparing-bandwidth-prices-and-network-latency-between-google-compute-zones-and-regions/ https://blog.elasticbyte.net/comparing-bandwidth-prices-and-...
- nodesocket 10y agoSo does Cloud Spanner replace the existing Google Cloud SQL offering [1]? What are the pros/cons of each? [1] https://cloud.google.com/sql/ https://cloud.google.com/sql/
- floatboth 10y agoThat offering is just normal managed MySQL, the new thing is a custom built database for huge scalability, much more expensive of course.
- nodesocket 10y agoRight that's what I was getting at, a typical web app does not and probably should not start with Cloud Spanner (ignoring the fact it costs $0.90 per hour per node). Cloud Spanner seems like it is attacking the big data market correct?
- floatboth 10y agoSomething like that. But not necessarily the Big Data that's being analyzed, that's usually done with Hadoop/Spark/whatever is the big thing now. It seems to be aimed at, like, huge apps that actually need horizontal scalability.
- campers 10y agoIt much closer to the Datastore https://cloud.google.com/datastore/ https://cloud.google.com/datastore/ which also has co-located parent-child tables and GQL instead of SQL, and automatic horizontal scalability
- richdougherty 10y agoSome interesting stuff in https://cloud.google.com/spanner/docs/whitepapers/SpannerAndCap.pdf https://cloud.google.com/spanner/docs/whitepapers/SpannerAnd... about the social aspects of high availability. 1. Defining high availability in terms of how a system is used: "In turn, the real litmus test is whether or not users (that want their own service to be highly available) write the code to handle outage exceptions: if they haven’t written that code, then they are assuming high availability. Based on a large number of internal users of Spanner, we know that they assume Spanner is highly available." 2. Ensuring that people don't become too dependent on high availability: "Starting in 2009, due to “excess” availability, Chubby’s Site Reliability Engineers (SREs) started forcing periodic outages to ensure we continue to understand dependencies and the impact of Chubby failures." I think 2 is really interesting. Netflix has Chaos Monkey to help address this (https://github.com/Netflix/SimianArmy/wiki/Chaos-Monkey https://github.com/Netflix/SimianArmy/wiki/Chaos-Monkey). There's also a book called Foolproof (https://www.theguardian.com/books/2015/oct/12/foolproof-greg-ip-review-biggest-risk-is-safety https://www.theguardian.com/books/2015/oct/12/foolproof-greg...) which talks about how perceived safety can lead to bigger disasters in lots of different areas: finance, driving, natural disasters, etc.
- fritzo 10y ago> perceived safety ... driving I became a way better winter driver when I started intentionally fishtailing in snow and ice (in low risk situations).
- richdougherty 10y agoThere's also research showing that removing safety features, e.g. white lines between opposing lanes, increases safety. http://www.bbc.com/news/uk-35480736 http://www.bbc.com/news/uk-35480736
- boulos 10y agoI experienced this in Drivers' Ed with special tires that were deflatable and inflatable under instructor control! Until I moved for grad school, I hadn't realized this wasn't more common.
- tajen 10y ago> $.90 per node per hour That makes $700 per month. Is this the minumum? or can we have 0 node when the lambda is idle ?
- Avloss 10y agoAmazing! But why does this feel like such a de ja vue all over again.. (surely I'm missing something).. They've spent 5 years telling us that we just CAN'T scale SQL.. Now they'll tell us that actually.. they've figured it out! :)
- esseti 10y agodoes anyone know if it works with django or a way to make it working? it should be a matter of a connector, no?
- crooked-v 10y agoNeat. How long until it gets shut down with a month's notice?
- danols 10y agoInteresting but without INSERT and UPDATE it just isn't worth it for me. When can we expect it to handle data manipulation language (DML) statements?
- gonyea 10y agoI can vouch for Spanner: it's a badass piece of Google's infrastructure.
- aladine 10y agoGreat product from Google. I wonder what is the difference between Cloud Spanner and Google CloudSQL
- kyrra 10y agoCloudsql is managed MySQL. Spanner is a custom in-house distributed database.
- sebringj 10y agoI was like YES!!! Then I read for a single node it is 90 cents per hours then I was like NO!!! so absolute minimal cost for me is $648/month? I was hoping there was like a dev version. Maybe I didn't read the fine print?
- therealmarv 10y agoI was thinking the same thing! Maybe it's better to look into some smaller service which offer e.g. PostgreSQL as a Service like https://www.elephantsql.com/plans.html https://www.elephantsql.com/plans.html or https://www.databaselabs.io/pricing/ https://www.databaselabs.io/pricing/ (I'm sure they are even more, just done a quick googling). Does somebody has experience with such services?
- sebringj 10y agoPostGres at least offers full text indexing. I couldn't find that on Cloud Spanner.
- elcct 10y agoIs it hosted on Google or NSA servers?
- sctb 10y agoIf you don't want this account to be banned, please stop posting snarky one-liners as we've asked multiple times.
- mallipeddi 10y agoFew questions from reading the docs: 1) How big can all the colocated data for a single primary key get before they don't fit within a split? Can I implement a GMail-like product where all the data for a single user resides within one split? 2) Is there a way to turn off external consistency and fall back to serializability? In return you get better write latencies. This is similar to what CockroachDB provides?
- the_cap_theorem 10y ago>> Remarkably, Cloud Spanner achieves this combination of features without violating the CAP Theorem. This is the best weasel PR language I have seen in a long time. Note that the sentence does not actually proclaim that they solved (the previously "unsolvable") problem of achieving distributed consensus with unreliable communication while maintaining partition tolerance and availability. The blog only says they don't "violate" the CAP theorem -- whatever that means. So the statement is technically correct. Still the intention is obviously to mislead the casual reader (why else would you start the sentence with "Remarkably"?). A litmus test: The same statement is true for MySQL - or _any other_ database in fact: >> "Remarkably, MySQL achieves this combination of features without violating the CAP theorem" It's a bit like saying >> "Remarkably, MySQL is not a perpetuum mobile"
- Beldur 10y agoHere is a very interesting video from 2013 of Martin Schoenert explaining the Google Spanner White Paper (In german though): https://www.youtube.com/watch?v=2QKewyoOSL0 https://www.youtube.com/watch?v=2QKewyoOSL0 Now he works for Google as an Engineering Manager.
- etherealG 10y agoI'd love to see a jepsen test. Maybe the spanner team would be able to sponsor an independent test?