CockroachDB (pay-as-you-go)
Reliable, Scalable, and Developer-Friendly Database
Reliable, distributed database that just works at scale
CockroachDB is awesome
Reliable and scalable SQL
Its main pros is that it keeps your data safe and available in different locations, which is useful for apps with users in many places.
Although, CockroachDB is a good choice for teams who want a reliable database that can grow as their business grows.
Cockroach DB review
Easy to work with, supports SQL.
Scales horizontally.
Low Latency
Provides developer-friendly environment with robust security and cost-efficiency
What is our primary use case?
We have been using CockroachDB for the last two years. From 2023, we started working on a product similar to Google Capture. We decided to work with CockroachDB with Hasura. Hasura is a UI for the database CockroachDB that provides a playground to work with the API and data. Since CockroachDB primarily supports SQL, we didn't want to use plain SQL in our programming, so we decided to go with ORM and selected Hasura. With Hasura, we sometimes require GraphQL. Besides using GraphQL, we have also used SQL with CockroachDB directly to get data and perform insert and update operations.
Regarding our operations, CockroachDB equals PostgreSQL plus Google Spanner, and we can remove scalability, then add resilience across regions.
For CockroachDB multi-active availability, all replicas of our data are active and can serve read and write simultaneously. Currently, we are not using these features because our database is not too large with only 20 customers using our application. MAA is a feature provided by CockroachDB, but they charge for this functionality. It has consequences by raft where each range of data is replicated with default three replicas. Writes go through raft consensus where a majority of replicas must agree, ensuring strong consistency even if some nodes or regions fail.
Regarding multi-region or global clusters, it allows spanning clusters across multiple regions. We are configured with AWS because we use Lambda functions on the server end. The zone configuration lets you control where replicas live, such as keeping EU customer data in EU and US customer data in US, though we aren't currently using this feature.
ACID transactions are not required in our application because we don't have any payment gateway currently. CockroachDB uses a two-phase commit protocol on top of raft consensus. If any part of the transaction fails, commits, times out, or node crashes, CockroachDB automatically rolls back.
The benefits include being developer-friendly, strong security with RBAC, encryption, and data residency laws by pinning data to specific regions. It is self-healing because if a node crashes, data automatically rebalances to healthy nodes without manual failover, replication, or clustering needed. Finally, it offers cost efficiency.
What is most valuable?
CockroachDB is excellent for managing relationships in RDBMS. There are multiple benefits such as the ability to create views and dynamic queries that save data and reduce the use of complex algorithms in code. Instead of writing algorithms to get desired output, we can directly call the views where predefined algorithms form the view to get the desired output.
CockroachDB's geo-distribution feature is superior to traditional databases. The admin UI can be used according to requirements. Compared to traditional databases PostgreSQL and MySQL, CockroachDB provides both SQL features and is horizontally scalable, meaning it is cloud-native. We can start with a single node and scale to hundreds of nodes across multiple regions. It automatically distributes data and workload without manual sharding.
The database offers high availability and fault tolerance with data replicated across nodes and regions. It is compatible with various drivers and ORMs including Prisma, Sequelize, and Hibernate. It provides automatic migrations and online schema changes. Security features include encryption in transit, role-based access control, and compliance with data residency laws by pinning data to specific regions.
CockroachDB supports ACID transactions and is cloud-native, allowing creation of hundreds of microservices with multiple regions. The automatic data and workload distribution eliminates the need for sharding, which is required in databases MongoDB.
What needs improvement?
The platform should provide a UI feature where users have the ability to manage it. The CockroachDB platform should have a chatbot where users can inquire about pricing or seek solutions for queries, rather than relying on email support.
The current UI only provides SQL playground, which is technical. There should be a UI playground where users with limited technical knowledge can run and update queries, similar to phpMyAdmin or Adminer.
Latency optimization could be improved for globally distributed applications, particularly in query routing. For multi-region deployment, CockroachDB requires at least three plus replicas across data centers to achieve strong consistency across regions, which increases infrastructure costs including compute, storage, and networking.
The disadvantages include cost-efficiency with multi-region deployment and schema migration speed, which should be faster compared to other drivers. The query optimizer should handle complex queries better through the UI interface.
For how long have I used the solution?
How are customer service and support?
How would you rate customer service and support?
Positive
How was the initial setup?
The setup was very straightforward. Everything was mentioned in the documentation, and even a layman or business analyst can complete the setup without having technical knowledge.
What other advice do I have?
The tech support deserves a rating of nine out of ten. My overall rating for CockroachDB is 8 out of 10.
Which deployment model are you using for this solution?
If public cloud, private cloud, or hybrid cloud, which cloud provider do you use?
Positive Experience switching PostgreSQL to CockroachDB
An amazing distributed sql db
Get out of the way and let me work!
And did I mention the support? Recently I had an issue where backups to an S3 compatible bucket stopped working. Within 24 hours I was on a call with a product manager talking through the issue to understand exactly what happened and what my recommended path forward would be. Yes, by running a serverless database in the cloud as a non-enterprise I am giving up some level of control, which is what happened here when they upgraded to the latest AWS S3 SDK that had some incompatible headers, but the tradeoff is that I have zero operational headaches to deal with.
The last feature that works perfectly with my business model is the pay-as-you-go model where I can spin up as many clusters and databases as I like without getting nailed for every instance. I am in early days and I'm constantly spinning up new clusters for testing or very small customers. When I can create an isolated cluster for a customer and it only costs me a few dollars a month that's a huge win.
Geo-replication benefits with distributed setup and a helpful AI support chatbot
What is our primary use case?
I am studying how to deploy CockroachDB and YugaByteDB, and learning some basic information about them. I am testing these databases as part of my school application to find a suitable database for our applications. Currently, I am using PostgreSQL, however, I want to try some distributed databases for testing purposes.
What is most valuable?
The most valuable feature is that CockroachDB is a distributed database, which can deploy nodes running in different regions. Geo-replication capabilities are also important for production applications. Having database servers close to my customers, for example, in the US or UK, would improve performance.
What needs improvement?
I would like CockroachDB to have more compatibility with PostgreSQL, especially with the connection string and technical integrations.
For how long have I used the solution?
I have been studying and testing CockroachDB and YugaByteDB for about six months.
How are customer service and support?
I did not contact the technical support by CockroachDB. However, their website has an AI chatbot, which I found to be very useful.
Which solution did I use previously and why did I switch?
Currently, I am using PostgreSQL. I want to try some distributed databases for testing purposes.
What about the implementation team?
I deployed a three-node database in a local system using Docker. I have successfully deployed a secure cluster.
What's my experience with pricing, setup cost, and licensing?
I am not very familiar with the pricing as I am now only in the experimental phase.
Which other solutions did I evaluate?
I am also studying and testing YugaByteDB alongside CockroachDB.
What other advice do I have?
I'd rate the solution eight out of ten.