cadence-workflow / cadence

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.
https://cadenceworkflow.io
MIT License
8.33k stars 801 forks source link

Create default domain for development docker image #2343

Open mfateev opened 5 years ago

mfateev commented 5 years ago

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 commented 5 years ago

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

mfateev commented 5 years ago

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

mfateev commented 5 years ago

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.

sagikazarmark commented 5 years ago

Is this feature on the roadmap?

samarabbas commented 5 years ago

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.

sagikazarmark commented 5 years ago

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.

samarabbas commented 5 years ago

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.

sagikazarmark commented 5 years ago

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.