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
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.
What is your expected initial transaction per second (TPS) count? Spanner might be overkill for a startup phase.
Cloud SQL for PostgreSQL is much more affordable for small teams and has great community support for ORMs like Sequelize or TypeORM.
True, Nancy. We started on Cloud SQL and only moved to Spanner once our European traffic started causing lock contention on the primary instance.
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.