Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CockroachDB support #1291

Closed
11 of 13 tasks
chappjc opened this issue Apr 22, 2019 · 5 comments
Closed
11 of 13 tasks

CockroachDB support #1291

chappjc opened this issue Apr 22, 2019 · 5 comments
Milestone

Comments

@chappjc
Copy link
Member

chappjc commented Apr 22, 2019

CockroachDB support should be a new feature for 5.0.

I'm fairly certain this is doable since CockroachDB is largely compatible with PostgreSQL, and github.com/lib/pq seems to support CockroachDB (see this recent pq PR).

However, there are a number of required changes, including:

These changes are just what I can come up with now, so it is very likely that there will be many more roadblocks along the way.

@chappjc chappjc added this to the 5.0 milestone Apr 22, 2019
@chappjc chappjc self-assigned this Apr 22, 2019
@chappjc
Copy link
Member Author

chappjc commented Apr 29, 2019

Quoting cockroachdb/cockroach#23061 (comment) in a thread about CockroachDB vs. PostgreSQL performance:

Your comparing a database ( PostgreSQL) that has had 21 years of development and is highly optimized for single system performance. If you go back 8 years in time, PostgreSQL lost hard to even MySql in every benchmark. They did a great job at fixing postgresql its performance issues.

Compare this to CockroachDB that is barely 3 year old. And has a totally different design philosophy.

CockroachDB is power is not speed. Its the ability to get a replicating, sharding database up and running with minimal effort. CockroachDB has lots of nifty features. Its the same reason why a lot of people started using PostgreSQL in the past. Because PostgreSQL was able to do things, that Mysql did not do ( or did not follow the standards ).

I doubt that CockroachDB will ever get the same performance in single system performance compared to PostgreSQL / Mysql. The real gain is again the ability to easily scale with more databases horizontally and still have a secure system for your data.

Try clustering on PostgreSQL vs CockroachDB and your results will be much more interesting. That is after you spend a few hours setting up clustering on PostgreSQL. Watch what happens when a PostgreSQL master or a slave drops. Or try having Master - Master on PostgreSQL. -1

Think of it like this: What is more valuable. The money you spend on a extra server or the money you spend on a database engineer. The extra server is maybe 100 a 200$ per month, where as the database engineer is going to be way more.

If your planning on running a single server website, then stick with MySQL / PostgreSQL / ... as they are heavily optimized the last 20 years for that task. If your goal is to expand your hosting horizontally, then MySQL / PostgreSQL / ... are really not the best choice.

Now some points about dcrdata:

  • dcrdata does not even support (yet) read-only dcrdata instances. Each dcrdata backend maintains its own PostgreSQL database.
  • It is not important for the dcrdata hosts to share the same DB backend. They area all processing the same data by virtual of being connected to the distributed Decred network (via dcrd).
  • Clustering and replication of the database for availability and fault tolerance is a non-issue since the entire DB is rebuilt from blockchain data.
  • Performance is very important for dcrdata, both the initial sync (inserts) and queries from the frontend.

@chappjc chappjc modified the milestones: 5.0, tbd Jun 10, 2019
@chappjc chappjc removed their assignment Jun 10, 2019
@ukane-philemon
Copy link
Contributor

@chappjc is this still a concern? so far there hasn't been a clear use case for cockroachDB, plus dcrdata has been using postgresql for this long.
What are the benefits of providing support for cockroachDB on dcrdata?

@chappjc
Copy link
Member Author

chappjc commented Feb 4, 2022

No we are ditching cockroach. It's not performant.

@chappjc chappjc closed this as completed Feb 4, 2022
@ukane-philemon
Copy link
Contributor

@chappjc there are unused function for cockroachDB, a new issue should be opened to clean-up codebase?

@chappjc
Copy link
Member Author

chappjc commented Feb 4, 2022

Yah, that would be fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants