Part 2: Azure SQL vs Google Spanner: How They Performed Under Real-World JMeter Workloads
Series: Performance Testing Databases the Right Way: A Real-World Engineering Journey
In Part 1 of this series, I shared how I approached database performance testing by modeling realistic workloads using Apache JMeter. Rather than relying on generic benchmarks, I wanted to simulate the way our application would interact with a database in the real world.
Once the workloads were ready, it was time to put two strong database contenders to the test:
- Azure SQL Database — Business Critical
- Google Cloud Spanner — Multi-region (NAM-15)
Both databases are designed to handle demanding workloads, but they have very different architectures and scalability characteristics.
However, I wasn't interested in how they performed in a vendor benchmark. I wanted to understand how they would perform against our schema, our queries, our concurrency patterns, and our workload.
The goal was straightforward: achieve a sustained throughput of 150 transactions per second (TPS) while maintaining acceptable response times.
What followed was an interesting comparison that ultimately influenced one of our most important architectural decisions.
Setting Up the Database Performance Tests
Before running the tests, I provisioned the two databases with configurations that I believed would be appropriate for our evaluation.
Azure SQL Database — Business Critical
For Azure SQL, I used the Business Critical service tier with the following configuration:
- Compute: 14 vCores
- Storage: 3 TB
- Database technology: Azure SQL
- Graph capability: SQL Graph
The Business Critical tier was one of the configurations I evaluated because I wanted to understand how it would handle our application's workload, particularly graph queries and concurrent reads and writes.
Google Cloud Spanner — Multi-Region NAM-15
For Google Cloud Spanner, I used the multi-region NAM-15 configuration.
- Deployment: Multi-region
- Minimum nodes: 1
- Maximum nodes: 5
- Database technology: Google Cloud Spanner
- Graph capability: Spanner Graph
I configured Spanner to scale between one and five nodes so I could evaluate how its performance changed as the workload increased.
What We Were Testing
An important aspect of this evaluation was that we weren't simply comparing traditional relational queries. Our application also relied on graph capabilities.
Both databases were evaluated using their respective graph implementations:
- Azure SQL Graph
- Spanner Graph
This made the evaluation more relevant to our actual application. The objective wasn't to benchmark generic SQL statements but to understand how these databases handled the operations and query patterns our application would execute.
Running the Same Workloads Against Both Databases
I reused the workload scenarios I had designed in Part 1.
Scenario 1 — Read-Heavy Workload
The first scenario was designed to simulate a workload where reads dominated the overall traffic.
| Operation | Percentage |
|---|---|
| Reads | 70% |
| Writes | 20% |
| Updates | 5% |
| Deletes | 5% |
Scenario 2 — Balanced Workload
The second scenario increased the proportion of write operations to simulate a more write-intensive workload.
| Operation | Percentage |
|---|---|
| Reads | 50% |
| Writes | 30% |
| Updates | 10% |
| Deletes | 10% |
I used the same workload distribution and test approach across both databases to make the comparison as meaningful as possible.
Rather than focusing only on maximum throughput, I paid attention to how each database behaved as concurrency increased, particularly how read latency, write throughput, and resource utilization changed under load.
Azure SQL: Excellent Read Performance, but Write Bursts Were a Challenge
Azure SQL Business Critical performed exceptionally well for our read-heavy workload.
Read queries were consistently fast, and the database was able to handle concurrent requests efficiently. This was particularly important for our application because graph queries formed a significant part of our database access patterns.
The performance was encouraging, especially as we increased the load.
Read Performance Was a Clear Strength
Azure SQL delivered very good read performance under the workloads we tested.
This was particularly noticeable when executing graph-related queries. The database was able to handle our read patterns efficiently, making it a strong candidate for an application where query response time was a critical requirement.
Write Bursts Created Pressure
Reads weren't the only thing I tested, though.
As we increased write concurrency and introduced write bursts, Azure SQL started showing some performance pressure. While it handled the workload reasonably well, write-heavy bursts were not its strongest area in our tests.
This was an important observation because database performance isn't just about how quickly a system can execute reads. A database must also handle concurrent writes without significantly degrading the overall application experience.
Nevertheless, its read performance and overall throughput made Azure SQL a strong contender.
Google Spanner: Impressive Write Scalability, but Read Latency Was Higher
Google Spanner presented a very different performance profile.
One of the things that impressed me most was how it handled concurrent writes. Spanner demonstrated strong write scalability as we increased the number of nodes and pushed more concurrent operations through the database.
However, read performance was a different story.
Spanner Scaled Well Under Concurrent Writes
Spanner's ability to scale write workloads was one of its strongest characteristics during our tests. As we increased the instance capacity, it handled concurrent writes very well. This was consistent with what I would expect from a database designed for distributed workloads and horizontal scalability.
If our application had been predominantly write-heavy, this behaviour would have been a significant advantage.
Read Performance Was Significantly Slower
The biggest challenge I encountered with Spanner was read latency. Even after making schema adjustments to better align with Spanner's data model and query patterns, read performance remained significantly slower than Azure SQL in our tests.
This was particularly relevant because our application relied heavily on graph-based queries.
Schema Optimization Wasn't Enough
I also explored schema changes to improve Spanner's query performance, including interleaved tables. The intent was to optimize data locality and improve the efficiency of the queries being executed. Although these changes helped align the schema with Spanner's design, the read performance still didn't come close to Azure SQL for our particular workload.
This reinforced an important lesson: schema optimization is essential when evaluating a database, but it doesn't guarantee that a database's performance characteristics will align with your application's workload.
Azure SQL vs Google Spanner: Our Performance Observations
Here is a qualitative summary of what I observed during the evaluation.
| Performance Aspect | Azure SQL Business Critical | Google Spanner Multi-Region |
|---|---|---|
| Read performance | Excellent | Significantly slower in our tests |
| Concurrent writes | Good, but write bursts created pressure | Scaled very well |
| Graph queries | Performed very well for our workload | Read latency remained high |
| Schema optimization | Worked well with our query patterns | Required schema adjustments, including interleaving |
| Scalability approach | Primarily vertical scaling for this configuration | Horizontal scaling across nodes |
| Overall fit for our application | Strong fit | Less suitable for our read-latency requirements |
These are observations from our workload and test configurations, not a universal ranking of the two databases.
Why We Ultimately Chose Azure SQL
At the beginning of this exercise, our primary performance requirement was to handle 150 TPS.
I wasn't looking for the database with the most impressive theoretical scalability. I was looking for the database that could reliably support our application while delivering the response times we needed.
Azure SQL was the clear winner for our workload.
Its read performance was significantly better, particularly for the graph queries that our application relied on. Although write bursts created pressure, it was still capable of meeting our throughput requirement of 150 TPS.
Spanner, on the other hand, impressed me with its ability to handle concurrent writes and scale horizontally. But its read latency was a significant disadvantage for our application.
Ultimately, we selected Azure SQL Business Critical because it provided the performance characteristics that mattered most to us.
Lessons I Learned From Benchmarking Azure SQL and Google Spanner
1. A database's strengths don't necessarily translate into your workload
Spanner's horizontal scalability and concurrent write capabilities were impressive. However, those strengths didn't automatically make it the best choice for our application.
2. Read latency can be just as important as scalability
A database that scales horizontally is not necessarily the database that delivers the lowest query latency for your workload.
3. Graph capabilities need to be evaluated using real queries
Both Azure SQL and Google Spanner offered graph capabilities, but the performance differences we observed were substantial.
Having graph support doesn't automatically mean that graph queries will perform similarly across databases.
4. Schema optimization is part of the benchmarking process
I didn't treat the initial schema as final. I made adjustments, particularly in Spanner, to better align with its data model and query execution characteristics.
A database benchmark should include reasonable schema and query optimization rather than testing only the initial implementation.
5. Performance testing should drive architectural decisions
The most important takeaway from this entire exercise was that database selection should be based on evidence.
Instead of choosing a database based on familiarity, popularity, or vendor benchmarks, I used our workload and performance requirements to guide the decision.
Final Thoughts
This was an interesting exercise because it challenged some of the assumptions I had going into the database evaluation.
Google Spanner impressed me with its concurrent write capabilities and scalability. Azure SQL, however, delivered significantly better read performance for our application and was able to meet our target of 150 TPS.
That made the decision relatively straightforward.
We chose Azure SQL Business Critical.
Not because it was universally better than Spanner, but because it was better suited to the workload we were building.
If there's one thing I would recommend to anyone evaluating databases, it's this:
Don't benchmark databases using workloads you don't understand. Model your application's behavior, test it under realistic conditions, and let the results guide your architectural decisions.
That is how I approached this evaluation, and it gave me the confidence to make one of the most important decisions in our application's architecture.