# Use CockroachDB for Rancher 2.0 internal database

**URL:** <https://forums.suse.com/t/use-cockroachdb-for-rancher-2-0-internal-database/7512>\
**Category:** Rancher 2.0 Tech Preview\
**Created:** [October 6, 2017, 8:26pm UTC](https://forums.suse.com/t/use-cockroachdb-for-rancher-2-0-internal-database/7512 "2017-10-06T20:26:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tlvenn](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@Tlvenn](https://forums.suse.com/u/Tlvenn)\
**Post date:** [October 6, 2017, 8:26pm UTC](https://forums.suse.com/t/use-cockroachdb-for-rancher-2-0-internal-database/7512/1 "2017-10-06T20:26:13Z")

</div>

Hi,

I was wondering if any though had been given to leverage CockroachDB to power up the internal database in Rancher 2.0 ?

It seems like it would be a pretty good fit and a better option than mysql imho. We are leveraging bare metal cloud providers and as such we don’t have access to services such as RDS and I really don’t want to have to deal with Mysql to begin with, even less so clustering it…

Thanks in advance

---

<div class="post-metadata">

**Author:** ![superseb](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/superseb/32/2424_2.png) [@superseb](https://forums.suse.com/u/superseb)\
**Post date:** [October 9, 2017, 3:47pm UTC](https://forums.suse.com/t/use-cockroachdb-for-rancher-2-0-internal-database/7512/2 "2017-10-09T15:47:48Z")

</div>

We are using [https://github.com/rancher/k8s-sql](https://github.com/rancher/k8s-sql) which uses really simple SQL statements ([https://github.com/rancher/k8s-sql/blob/master/dialect/mysql/mysql.go](https://github.com/rancher/k8s-sql/blob/master/dialect/mysql/mysql.go)) so it shouldn’t be too hard to get this working. If we are going to integrate and test it, I don’t think this will happen before 2.0 as we have a lot of work to do in other regions to get 2.0 shipped.

---

<div class="post-metadata">

**Author:** ![Tlvenn](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@Tlvenn](https://forums.suse.com/u/Tlvenn)\
**Post date:** [October 9, 2017, 4:56pm UTC](https://forums.suse.com/t/use-cockroachdb-for-rancher-2-0-internal-database/7512/3 "2017-10-09T16:56:04Z")

</div>

Thanks for the reply @superseb.

Looking at the repo and the code actually gives me more questions than answers…  
Given how trivial the dialect is, I really wonder what is the value beyond a PoC to leverage a full blown SQL database for a simple key value store while ETCD is already battle tested and leveraged in K8 ?

I understand it could be an option for people who dont want to deal with ETCD to begin with but why is it the default ?

Wouldn’t it be more reasonable and safe to use ETCD by default ?

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [October 9, 2017, 5:30pm UTC](https://forums.suse.com/t/use-cockroachdb-for-rancher-2-0-internal-database/7512/4 "2017-10-09T17:30:59Z")

</div>

k8s-sql is a small shim for storing the part normally stored in etcd into the mysql DB we already have so that we don’t have to maintain a separate etcd. The main portion of Rancher is MySQL.

While you may not have RDS as an option, a large percentage of users do have a hosted MySQL option and/or a team with MySQL experience available in-house. Neither of these is true of etcd or (especially) cockroach.
