Agreed with Dmitri and Eric.

Since I worked on the PR, I thought I’d share a bit of context. I agree
that schema should not be a first-class concern, and that realm
bootstrapping should be the main concept users care about. I also agree
that a full bootstrap should remain the default behavior, but having an
explicit schema setup step could offer more flexibility when neeeded.

Best,

Seungchul Lee.



On 2025/08/01 10:41:16 Alexandre Dutra wrote:
> Hi all,
>
> A nice recent contribution [1], still under review, proposes to create
> a separate admin tool command for setting up the database schema.
>
> Currently, schema setup is done as part of realm bootstrapping [2],
> which can happen at server bootstrap, when running the tool’s
> bootstrap command, or on-demand, depending on the RealmContextResolver
> in use. For this reason, the setup script must be idempotent.
>
> But the PR raised several questions. I will try to summarize them here:
>
> 1) Should schema setup be separate from realm bootstrapping?
>
> 2) Should the server perform schema setup at all? If so, when? At
> startup, or when a new realm is resolved?
> - Side question: if the server doesn’t perform schema setup, how are
> tests going to do it?
>
> 3) Do we want/need to support – or at least leave the door open for –
> different schemas per realm?
>
> 4) If we introduce an option to control how schema setup is done:
> - Should it be a configuration option in application.properties? It
> would then be available to both server and tool.
> - Should it be an option of the admin tool’s `bootstrap` command?
> Opt-in or opt-out?
> - Should it be an admin tool’s separate command like `setup` ?
>
> For 4) I would be in favor of a new configuration option, e.g.:
>
> polaris.schema.setup-mode=NEVER|STARTUP|PER_REALM
>
> It would be accessible to both server and tool, and the default could
> be NEVER for production, and AT_STARTUP for tests. PER_REALM could be
> introduced later.
>
> I’m curious to see what others think.
>
> Thanks,
> Alex
>
> [1] https://github.com/apache/polaris/pull/2196
> [2]
https://github.com/apache/polaris/blob/2117dbd08e8352b32a2c948ed6c166d7c77da50a/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java#L148-L158
>

Reply via email to