Multiregion Serverless and YCSB

Andrew Deally
4 min readJan 4, 2023

Part 3

My prior articles, “Regional Survivability optimized YCSB Client and RBR” and “CockroachDB 22.1 Multi Region Abstractions with YCSB” explored the YCSB workloads with a multiregion dedicated cluster. Soon after, Cockroach released the serverless beta version. This writeup is to illustrate how Serverless can also be to run a workload like YCSB. There are many benefits to serverless such as no server planning, easy scale and simple to spin up and use — its great to quickly develop an application which requires a distributed SQL cloud-native database designed for consistency, resiliency, located data and scale. Lets get started..

Spinning up a 3 region serverless is as easy as 1,2,3.

Serverless Create GUI

within your Cockroach Cloud organization, choose a serverless cluster across 3 regions..

after specifying the cluster name, 10 seconds later you have a cluster up and running across 3 regions. Serverless give up to 5 GB of storage and 250M RU’s to process the data for FREE! In my case, I will add a spend limit as I want to to scale my cluster workload to exceed the free tier. Pull down the Certs required to connect to my cluster, I am able to interact with the database using the Postgres driver and Cockroach SQL client.

Using the same YCSB client as before,

I loaded 1M rows and now able to run my YCSB application from a client node in one of my regions. Since, the latency b/w regions is high due to my locations in Asia, europe and central US, DML operations will have have higher latency due to quorom writes across regions. I have also setup my database to be primary in us-central1 with region survivability and my usertable is regional by row with data homing enabled. So far I am able to recreate the same test cases from my prior articles on a Multiregional dedicated cluster.

running Workload A

We can see how easy it is to monitor performance and query execution. The following displays the key metrics which drive the serverless billing.

Storage Usage, RU’s and SQL statements

These Metrics resemble what you would see under the DBConsole, which highlights latency of SQL executions.

Metrics commonly used for DB utilization and performance

And we can find the details of SQL , transactions and session activity which now includes the active executions for real time query execution..

SQL Activity Page is very similar to DB Console

And you can drill into each SQL and review the plans and we can see below, the plan for the usertable update query which does a cross region check for a given key.

After running the workload for a day, I can estimate my overall monthly cost of this cluster by using the “Estimate usage cost” hyperlink

So that wraps up the short tour of Serverless setup and usage with the YCSB client.

--

--