Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local development with cloud-spanner

Tags:

Is there any way to do local development with cloud spanner? I've taken a look through the docs and the CLI tool and there doesn't seem to be anything there. Alternatively, can someone suggest a SQL database that behaves similarly for reads (not sure what to do about writes)?

EDIT: To clarify, I'm looking for a database which speaks the same flavour of SQL as Cloud Spanner so I can do development locally. The exact performance characteristics are not as important as the API and consistency behaviour. I don't think Cockroach meets these requirements?

like image 943
Daniel Compton Avatar asked Feb 17 '17 05:02

Daniel Compton


People also ask

What is Cloud Spanner used for?

Automatic database sharding Cloud Spanner optimizes performance by automatically sharding the data based on request load and size of the data. As a result, you can spend less time worrying about how to scale your database and instead focus on scaling your business.

Which languages you can use with Cloud Spanner?

Google Cloud Spanner offers multi-language support, as it has client libraries with language, C#, Go, C++, Node. js, Python, Ruby, and PHP.


1 Answers

There is currently no local development option for Cloud Spanner. Your current option would be to start a single node instance on GCP.

There currently isn't another database that operates like Cloud Spanner, however CockroachDB operates on similar principles. Since they don't have access to atomic clocks and GPS units, they do make different trade-offs. In particular around reads & writes and lacking 'stale reads'. You can read more on the Jepsen blog:

Where Spanner waits after every write to ensure linearizability, CockroachDB blocks only on contested reads. As a consequence, its consistency guarantees are slightly weaker.

like image 81
Dan McGrath Avatar answered Nov 08 '22 23:11

Dan McGrath