Skip to content

Draft: Experimenting with CockroachDB

Alex Gleason requested to merge cockroachdb into develop

I experimented with CockroachDB as an alternative to Postgres with better horizontal scaling capabilities. It's written from the ground-up in Go, but it supports the Postgres wire protocol, meaning it can deal with queries in the Postgres SQL dialect. It can use the Postgres Ecto adapter, too.

This is very messy and I just wanted to upload it somewhere for prodigy.

It seems CockroachDB is lacking at least these features, and possibly others:

  • citext
  • to_tsvector()
  • pg_trgm
  • uuid-ossp

And has these limitations:

  • Not possible to create an index on an array field.
  • Weird bug during ALTER TABLE where it tries to apply constraints to a different column in the transaction, unless you order them in the right way.
  • You can't lock tables (??)

I've just been commenting out indexes trying to get it to run, but ultimately I was blocked on 20181218172826_users_and_activities_flake_id. It doesn't support uuid-ossp so there's nothing to do here.

It would be cool if there were some way to conditionally support it, but right now it's lacking too many features. It seems like it might be more lucrative to implement those missing features into Cockroach DB first, or wait until someone does.

Edited by Alex Gleason

Merge request reports

Loading