Yahoo’s migration process is made easier with a new Cassandra to Spanner adapter.
A popular key-value NoSQL database for applications like caching, session management, and real-time analytics that demand quick data retrieval and storage is Cassandra. High performance and ease of maintenance are ensured by its straightforward key-value pair structure, particularly for huge datasets.
However, this simplicity also has drawbacks, such as inadequate support for sophisticated queries, the possibility of data repetition, and challenges when it comes to modeling complicated relationships. In order to position itself for classic Cassandra workloads, Spanner, Google Cloud’s always-on, globally consistent, and nearly infinite-scale database, blends the scalability and availability of NoSQL with the strong consistency and relational nature of traditional databases. With the release of the Cassandra to Spanner Proxy Adapter, an open-source solution allowing plug-and-play migrations of Cassandra workloads to Spanner without requiring modifications to the application logic, switching from Cassandra to Spanner is now simpler than ever.
Spanner for NoSQL workloads
Strong consistency, high availability, nearly infinite scalability, and a well-known relational data model with support for SQL and ACID transactions for data integrity are all features that Spanner offers. Being a fully managed service, it facilitates operational simplification and frees up teams to concentrate on developing applications rather than managing databases. Additionally, by reducing database downtime, Spanner’s high availability even on a vast global scale supports business continuity.
Spanner is always changing to satisfy the demands of contemporary companies. Improved multi-model capabilities including graph, full-text, and vector searches, higher analytical query performance with Spanner Data Boost, and special enterprise features like geo-partitioning and dual-region settings are some of the most recent Spanner capabilities. These potent features, together with Spanner’s alluring price-performance, provide up a world of fascinating new opportunities for Cassandra users.
Yahoo has put the Cassandra to Spanner adapter to the test
“Spanner sounds like a leap forward from Cassandra,” in case you were wondering. How can I begin? The proxy adapter offers a plug-and-play method for sending Cassandra Query Language (CQL) traffic from your client apps to Spanner. The adapter works as the application’s Cassandra client behind the scenes, but it communicates with Spanner internally for all data manipulation operations. The Cassandra to Spanner proxy adapter simply works without requiring you to migrate your application code!
Yahoo benefited from increased performance, scalability, consistency, and operational efficiency after successfully migrating from Cassandra to Spanner. Additionally, the proxy adapter made the migration process simple.
Reltio is another Google Cloud client that has made the switch from Cassandra to Spanner. Reltio gained the advantages of a fully managed, globally distributed, and highly consistent database while minimizing downtime and service disruption through an easy migration process.
These success examples show that companies looking to upgrade their data architecture, uncover new capabilities, and spur creativity may find that switching from Cassandra to Spanner is a game-changer.
How is your migration made easier by the new proxy adapter? The following procedures are involved in a typical database migration:
Some of these stages are more complicated than others, such as moving your application (step 4) and moving the data (step 6). Migrating a Cassandra-backed application to point to Spanner is made much easier by the proxy adaptor. A high-level summary of the procedures needed to use the new proxy adapter is provided here:
- Assessment: After switching to Spanner, determine which of your Cassandra schema, data model, and query patterns may be made simpler.
- Schema design: The documentation thoroughly discusses the similarities and differences between Spanner’s and Cassandra’s table declaration syntax and data types. For optimum efficiency, you can additionally utilize relational features and capabilities with Spanner, such as interleaved tables.
- Data migration: To move your data, follow these steps:
- Bulk load: Utilizing programs like the Spanner Dataflow connector or BigQuery reverse ETL, export data from Cassandra and import it into Spanner.
- Replicate incoming information: Use Cassandra’s Change Data Capture (CDC) to instantly replicate incoming updates to Spanner from your Cassandra cluster.
Updating your application logic to execute dual-writes to Cassandra and Spanner is an additional option. If you want to make as few modifications to your application code as possible, google Cloud do not advise using this method.
- Update your Cassandra setup and set up the proxy adapter: The Cassandra to Spanner Proxy Adapter operates as a sidecar next to your application; download and start it. The proxy adapter uses port 9042 by default. Remember to modify your application code to point to the proxy adapter if you choose to use a different port.
- Testing: To make sure everything functions as planned, thoroughly test your migrated application and data in a non-production setting.
- Cutover: Move your application traffic to Spanner as soon as you are comfortable with the migration. Keep a watchful eye out for any problems and adjust performance as necessary.
What does the new proxy adapter’s internal components look like?
The application sees the new proxy adaptor as a Cassandra client. The Cassandra endpoint’s IP address or hostname has changed to point to the proxy adapter, which is the only discernible change from the application’s point of view. This simplifies the Spanner migration without necessitating significant changes to the application code.
To provide a one-to-one mapping between every Cassandra cluster and its matching Spanner database, Google builds the proxy adapter. A multi-listener architecture is used by the proxy instance, and each listener is connected to a different port. This makes it possible to handle several client connections at once, with each listener controlling a separate connection to the designated Spanner database.
The complexities of the Cassandra protocol are managed by the translation layer of the proxy. This layer handles buffers and caches, decodes and encodes messages, and most importantly parses incoming CQL queries and converts them into counterparts that are compatible with Spanner.
To gather and export traces to Cloud Trace, the proxy adapter supports OpenTelemetry.
Taking care of common issues and difficulties
Let’s talk about some issues you might be having with your migrations:
Cost: Take a look at Accenture’s benchmark result, which shows that Spanner guarantees cost effectiveness in addition to consistent latency and throughput. To help you utilize all of Spanner’s features, the company has also introduced a new tiered pricing structure called “Spanner editions,” which offers improved cost transparency and cost-saving options.
Latency increases: When executing the proxy adapter in a Docker container, Google advises running it on the same host as the client application (as a side-car proxy) or on the same Docker network to reduce an increase in query latencies. Additionally, Google advised limiting the proxy adapter host’s CPU usage to less than 80%.
Design flexibility: Spanner’s more rigid relational design gives benefits in terms of data integrity, query capability, and consistency, but Cassandra offers more flexibility.
Learning curve: There are some distinctions between Cassandra’s and Spanner’s data types. Examine this thorough material to help with the transition.
Start now
For companies wishing to take advantage of the cloud’s full potential for NoSQL workloads, Spanner is an appealing choice due to its robust consistency, streamlined operations, improved data integrity, and worldwide scalability. Google Cloud is making it simpler to plan and implement your migration strategy with the new Cassandra to Spanner proxy adapter, allowing your company to enter a new era of data-driven innovation.