Cloud Technology

Choosing between Cloud SQL and Cloud Spanner for a globally distributed retail application?

R Asked by Robert White · 20-06-2023
0 upvotes 16,607 views 0 comments
The question

We are launching a global e-commerce platform and need a relational database. We expect high write volumes from users in Europe, Asia, and North America simultaneously. Cloud SQL seems easier to manage, but I’m worried about latency and consistency across regions. Does Spanner really provide "unlimited" scaling without the headaches of manual sharding? 

3 answers

0
P
Answered on 22-06-2023

If you need horizontal scaling and global "strong consistency," Spanner is the only choice. Cloud SQL is great for single-region apps or apps with a clear "primary" region and read-replicas elsewhere, but it struggles with "cross-region writes." Spanner was built for exactly your use case—it uses atomic clocks to manage distributed transactions. The downside is the cost and the learning curve for its SQL dialect. If your retail app grows to millions of users, Spanner will prevent you from having to re-architect your database in two years when Cloud SQL hits its limit. 

0
JO
Answered on 24-06-2023

What is your expected initial transaction per second (TPS) count? Spanner might be overkill for a startup phase. 

CH 25-06-2023

Joseph, we’re expecting around 500 TPS at launch, growing to 5000+. Is that enough to justify Spanner? At 500 TPS, Cloud SQL can handle it easily. But at 5000+ with global users, you'll start hitting replication lag issues. If you have the budget, start with a small Spanner instance to save yourself a massive migration later.

0
NA
Answered on 26-06-2023

Cloud SQL for PostgreSQL is much more affordable for small teams and has great community support for ORMs like Sequelize or TypeORM. 

PA 27-06-2023

True, Nancy. We started on Cloud SQL and only moved to Spanner once our European traffic started causing lock contention on the primary instance.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session