cadence icon indicating copy to clipboard operation
cadence copied to clipboard

Create default domain for development docker image

Open mfateev opened this issue 6 years ago • 9 comments

Setting up a domain is an additional concept which is not needed for the majority of the customers which are just starting with Cadence.

I would propose creating "default" domain automatically and change all samples to use it. I would also support domain creation as a docker image argument (or may be the schema setup argument?) even for single tenant production deployments.

mfateev avatar Aug 05 '19 17:08 mfateev

And default the CLI domain option to the default one to not require it initially.

mfateev avatar Aug 05 '19 18:08 mfateev

https://github.com/sagikazarmark/cadence-bootstrap

mfateev avatar Aug 13 '19 16:08 mfateev

Consider having a flag when starting Cadence to prohibit registering new domains to distinguish single domain deployments. This would make hiding domain feature easier in CLI and UI.

mfateev avatar Aug 13 '19 17:08 mfateev

Is this feature on the roadmap?

sagikazarmark avatar Sep 06 '19 22:09 sagikazarmark

Having a default domain for developer setup definitely sounds like a nice feature as it removes additional step of domain registration for someone new trying out Cadence. But I don't think having seamless domain registration for Production clusters is a good idea.
There is a lot of behavior tied to domain entity like retention, archival, replication, etc that hiding of all that would cause issues later down the road. It is much better for users to understand all those concepts before running production load.

samarabbas avatar Sep 08 '19 18:09 samarabbas

I have two use cases for this feature:

  1. In a development environment I want to avoid every extra setup steps as possible. Currently we do that by creating a default domain in the app (which is arguably worse. In this sense a Cadence domain is similar to a database. Just don't create it from your app)
  2. We ship cadence with our platform. We use a single domain with predefined configuration. Unfortunately, we are once again forced to create the domain from within the application.

In both cases there is a need to have a domain set up with predefined settings and it is achieved one way or another. IMHO it's not a "default" domain that's important, but the ability to automatically setup domains.

I would imagine this as a configuration setting which would require the user to enter certain information that in turn would presume that the user understands the domain concept.

sagikazarmark avatar Sep 08 '19 18:09 sagikazarmark

I'm completely with you about 1. We need to make that easier and having domain created with default settings removes one friction point for someone new from trying out Cadence.

Cadence is more like database and creation of domain is like creating Cassandra keyspace. I have not seen any database setup where application specific entities are pre created as part of database setup. These entities are always created separately.

Do you expect your customers to directly use Cadence CLI? Or Cadence is completely hidden from them? I do see your point to expose a hook for single domain installations does makes things simple. The thing I'm worried about is supporting this feature for all possible use cases will make Cadence docker setup hard to maintain.

samarabbas avatar Sep 08 '19 19:09 samarabbas

Or Cadence is completely hidden from them?

Yes it is.

The thing I'm worried about is supporting this feature for all possible use cases will make Cadence docker setup hard to maintain.

I'm not sure why. I imagine this feature would be exposed as an env var and mapped to configuration.

MySQL starts with a default test database, yet everyone knows that it's not recommended for production use.

The alternative is a Cadence bootstrap component (like the one linked above), but it has to wait for Cadence to be ready and waiting on resources is always a pain.

sagikazarmark avatar Sep 08 '19 20:09 sagikazarmark

There are 2 flavors of docker image Cadence releases. One is for production use (TARGET=server) and the other is for local development (TARGET=auto-setup).
The startup script invoked in "auto-setup" mode sets up DB schema and it can also register a test domain so there's one less command to run for users each time they start a fresh cluster locally or in CI/CD.

taylanisikdemir avatar Dec 03 '24 01:12 taylanisikdemir

@taylanisikdemir This ticket should be closed.

ins-tril avatar Aug 13 '25 05:08 ins-tril