laravel / ideas

Issues board used for Laravel internals discussions.
940 stars 28 forks source link

[Proposal] Support for CockroachDB #1378

Open centerorbit opened 6 years ago

centerorbit commented 6 years ago

Approach

While CockroachDB is modeled after Google Spanner (which aligned with MySQL) it is actually more compatible with PostgreSQL in the fact that it re-uses PostgreSQL’s network protocol and aligns pretty closely with it's SQL dialect.

With this in mind, we can quite easily piggy-back off of the current Postgres implementation and extend it to provide the minor tweaks necessary to support Postgres

Next Steps

I already have a working example that's running from a forked version of the read-only illuminate/database repo based from v5.7.11. You can see the changes here: https://github.com/illuminate/database/compare/v5.7.11...centerorbit:cockroach

Default Configuration

I also have config/database.php configuration stubbed out, but what has been puzzling me is that Lumen seems to 'auto-configure' with database defaults if this file isn't present. I was unable to find where this was happening, so was unable to make the cockroach driver auto-configure; so the database.php file is necessary for it to work.

More information about CockroachDB:

https://www.cockroachlabs.com/ https://github.com/cockroachdb/cockroach

Excerpt from Wikipedia: CockroachDB is designed to run in the cloud and be resilient to failures. CockroachDB is open-source software that is designed to store copies of data in multiple locations in order to deliver requested data when needed. The result is a database that is described as "almost impossible" to take down. Even if multiple servers or an entire datacenter were to go offline, CockroachDB would aim to keep services online.

leenooks commented 5 years ago

Will this proposal make it into laravel? I've been using nbj/cockroachdb-laravel, but I'm having some issues with it.

bytewoopy commented 5 years ago

Curious if there has been any traction on this? Is there a package I can add. Only option i can find is the njb one so far.

centerorbit commented 5 years ago

See: https://github.com/laravel/framework/pull/26380 for information on how to use Cockroach in an unofficially supported fashion.

awoods187 commented 4 years ago

PM at Cockroach Labs. We'd love it if you added support. Let us know if you run into any problems.