Try Cloud Spanner

18
Cloud Spanner Simon Su / Cloud GDE

Transcript of Try Cloud Spanner

Cloud Spanner Simon Su / Cloud GDE

Spanner vs. Traditional SQL/NoSQL

Spanner introduction● Global Scale

Horizontally scalable across regions and data centers, from 1 to hundreds or thousands of nodes

● Fully ManagedDatabase management service means replication and maintenance are automatic

● Relational SemanticsEverything you would expect from a relational database - schemas, ACID transactions, and SQL queries (ANSI 2011)

● Multi Language SupportClient libraries in Java, Go, Python, Node.js and more coming. JDBC driver for connectivity with popular third-party tools

Spanner introduction● Transactional Consistency

Purpose built for strong, global transactional consistency

● Enterprise Grade SecurityData-layer encryption, IAM integration for access and controls, and audit logging

● Highly AvailableWhenever, wherever, your data is highly available

Interactive with Cloud Console

Create new Spanner instance

Performance guidance● Each Spanner node can provide up to 10,000 QPS of reads or 2000 QPS

of writes (writing single rows at 1KB data per row), and 2 TiB storage.● For optimal performance, we recommend provisioning enough nodes to

keep overall CPU utilization under 75%.● Minimum of 3 nodes recommended for production environments.● Note that Cloud Spanner performance is highly dependent on workload,

schema design, and dataset characteristics. The performance numbers above are estimates, and assume best practices are followed.

Create Database

Database view

Data preview

Query from GCP web console

Spanner SQL Execution Plan

Spanner permission control

Resize Spanner instance

Piece of Code...

Small RESTful test with Spanner

RESTful result$ time curl -sS localhost:3000/singer/2 -d firstname=simon -d lastname=su -X POST

$ time time curl -sS localhost:3000/singer/list

See: https://github.com/peihsinsu/try-spaner

Summarize Spanner benefit

● Pay by use with the storage

● Throughput scaleout by extend instance size

● With transaction and strongly consistent

● Full managed by Google

~ The most I love ~

~ Thanks ~