Question about the new license (BSL)

There’s a comment on hackernews that should be answered.

I’m surprised everyone is saying it’s clear, because I think it’s sort of vague, so maybe someone can talk me out of it. :slight_smile:

If I build a service that lets customers define object types by dragging form widgets, and I turn that into a CRUD app backed by CockroachDB, and they just get to pick a CSS template and occasionally get Excel dumps, are they controlling the schema? They don’t write any SQL, they certainly don’t ever type or see the words CREATE TABLE, but internally I create a table for each of their types with a schema generated from their input, does that count?

Someone else asked about hiring a sysadmin consulting service. If I go to them and say, “Hey, my consulting firm will install and maintain your production servers, pay us $N/hour for routine changes and $kN/hour to page us,” but they have their own developers who write code and can cobble together dev infra if needed, can they choose to use CockroachDB? In my reading of the license, they have the right to make it available to us as their contractor, but we don’t have the right to download and install it and make it available to them for them (or us!) to run their CREATE TABLE statements on.

(I appreciate that edge cases are hard, and that while “just leave it open source” provides easy answers to these questions, it obviously brings other difficulties that you care about avoiding!)

Here’s another one: if I run some website that’s backed by Cockroach and has its own source code available publicly for pull requests (think Reddit until a few years ago, etc.), and one of my customer sends me a pull request that changes a schema in order to implement a feature they care about, does that count?

Yes, that still counts as a “database service”, because the schema is generated from the user’s input and therefore under their control.

Sysadmins that operate as consultants or subcontractors are fine. The client company needs to understand and accept the BSL license terms (just like they need to understand and accept the license terms of all software running on their behalf), but once they do that the sysadmins can download and install the software on their behalf. The fact that the sysadmins are subcontractors instead of employees wouldn’t automatically create a situation where they are considered to be running a database service that they sell to their clients.

No, this wouldn’t count. The key distinction is whether users of the service, acting as users, can control the table schema. Someone who submits a pull request would be acting as a developer rather than a user; the fact that some users may also be developers who have other ways to affect the schema doesn’t make it a database service.

Thank you for the reply.
The reason I wanted this question answered is that I have a client that has a ERP system that has a drag&drop tool to create new screens and those are backed by tables. But I think we could change those to a generic table with json and manage metaschema in another table. Maybe materialize those as views. Is that allowed? It’s still using the input as the source for the generated view, so I guess that is also out of the question. So we could add a CTE query to transform the json to rows… Don’t know if it’s worth the effort, since regular pg + failover will be enough for now.

Yes, a generic table with JSON would be allowed by the free license. Customer-controlled views are also allowed (the license grant specifically refers to customer-controlled tables), but note that we don’t currently support materialized views.

I’d also urge you to consider an enterprise license before you contort your application to fit within the bounds of the free license :slight_smile:

Suppose I were to create some fixed-structure tables for each customer, e.g.

  • table “customer1_objects” with columns “uuid”, “type”, “json_data”
  • table “customer1_types” with columns “type”, “validations”, “indexes”
  • table “customer1_index” with columns “uuid”, “type”, “field”, “value”

The form widgets populate these tables, and the metadata within the customerX_types table controls the rendering and validation of user data. Would that be allowed?

It might be useful to provide additional context here in the form of a pointer to a discussion of enterprise license costs. I made a desultory search for that a while back without success. It may, in fact be easily available or at least no harder than, say, Oracle’s fee structure; I didn’t really look hard because I have no interest in running anything remotely like a database service and the free license (both before and after the change) suits me well.

Trying to coerce an application into compliance with a no-cost license is meaningful only if the cost of the paid license is known.

Well, I was just trying to probe the edge cases of the licence a bit. Suppose you provide a service where the end user appears to have control of the schema, but in fact there is a fixed structure at the SQL layer?

I can certainly conceive someone writing an ORM which works with fixed tables and JSON. At some level, this is how Cockroach itself works: there is a flat K/V store and the SQL schema and indexing is a shim on top of this.

Using fixed tables and JSON would be allowed. It doesn’t matter whether it appears that the user is creating and modifying tables, but whether there are actual SQL schema changes happening. Roughly speaking, as long as there is no action a user can take that results in an ALTER TABLE being executed, you’re in the clear (a few ALTER TABLE substatements are probably fine too. ALTER TABLE SPLIT AT is probably the most useful one in this context. It doesn’t alter the table schema so it would be allowed)