← All articles
Security & Governance Business Leaders · · By ObjectStack Team

Should Your Business App Live in a Database or a Repository?

Configuration in a platform's database, or a definition in your repository? One permission change in an open-source CRM, traced and undone on ObjectStack 18.6.0, shows which questions each choice lets you answer.

Should Your Business App Live in a Database or a Repository? Should Your Business App Live in a Database or a Repository?
  • Metadata
  • Reviewable diff
  • AI agents

If AI agents change your business software, keep the master copy of its rules as files in a repository you control, and build the running system from them. Every change arrives as a dated, signed before-and-after with a written reason, so “who let sales do that, and why?” is answered from the record, not memory. The price is twofold. Established platforms like Salesforce and Odoo bring years of production use, packaged apps and partners; repository-first means building more yourself. And every change has to be proposed and accepted in the repository, a step an admin screen does not ask for.

Measured on ObjectStack 18.6.0, the version a new install gets today: the git history of its open-source CRM example at the release tag, and the published 18.6.0 command-line tool run against that example. Every command is in The proof.

Configuration or definition: which copy wins?

Both kinds of platform do the same visible job. You describe your business (customers, deals, who may edit what) and the platform turns that description into database tables, screens and a programming interface (an API). A platform that works this way is called a metadata platform: the description it runs from is metadata, data about your data. ObjectStack’s own comparison page calls these platforms “the closest relatives”: “Salesforce’s metadata is the ancestor; open-source cousins include Frappe Framework with ERPNext, Odoo, NocoBase, Payload and Twenty.” It names the difference in one sentence:

Where the definition lives, and who it is written for. In most of these platforms metadata is configuration stored in the platform’s database and edited through its UI; where it is code, as with the Payload Config or Odoo’s modules, it is framework code.

Framework code here means code written for that one platform. The useful question for a buyer is narrower than “metadata or code”. It is: which copy is authoritative? The authoritative copy is the one that wins when the running system and any other copy disagree.

  • Configuration. The running system’s database holds the authoritative copy. You change the system by changing it, usually through an admin screen, and a file, if you keep one, describes what is running.
  • Definition. A set of files in your repository holds the authoritative copy, and the running system is built from them. You change the system by changing a file, and the change takes effect after the build, the step that turns the files into the running system.

These are two ways of working, not two lists of vendors. Several of the platforms named above can also be run from files; ask each vendor which way its customers actually work. ObjectStack, which publishes this post, is the repository-first kind.

Two ways to keep a business app's rules. On the left, a definition: the files in your repository are the authoritative copy, and every change to them is a diff with a name and a written reason; the build checks the files and turns them into the running system, which is rebuilt from them at each deploy. On the right, configuration: an administrator changes settings in an admin screen, the running system and its database are the authoritative copy, and a file, if you keep one, describes what is running

A repository is a version-controlled folder, usually hosted on GitHub or GitLab, that keeps every change as a before-and-after with an author, a date and a message. That before-and-after is called a diff. A pull request is a proposed change shown that way, which someone accepts into the main copy. Both kinds of platform can keep history; this post makes no claim about any vendor’s own change tracking, so check it for the platform you are weighing. What the choice decides is where “what is true right now, and since when?” gets answered, and where a change is read before it takes effect: in a file’s history, or in the platform’s own records and tools.

That matters more now that an AI agent writes many of the changes. In the example below, an AI coding agent is recorded as co-author on every one of the seven changes to the sales roles’ permission file.

One permission change, traced

ObjectStack’s repository ships an open-source CRM example, a demonstration app rather than a customer system. In August 2026 its sales role could open deals but could not add product lines to them: the platform refused every user who was not an administrator. The fix added one permission line, and one row to the app’s access table: a list, saved in the repository, of what each role may create, read, edit and delete. We put to the permission file’s history the questions an auditor or a finance lead would ask, then undid the fix on today’s release to see what would stop it.

What we askedWhat the record answeredWhat it means for you
How often has the sales roles’ permission file changed?7 times since it took its current name on 9 July 2026, most recently on 6 November. Each change has a date, an author, a numbered pull request and a written reason.The audit question is answered from the file’s own history, not from anyone’s memory.
Who wrote those changes?An AI coding agent is recorded as co-author on all 7. Across the CRM example’s source files, 49 of the 50 changes since 1 July 2026 carry the same co-author line (71 of 218 over the example’s whole history, which starts in February 2026).AI is already writing the definition, and the record says so.
Who approved them?GitHub’s review record shows an approval on 1 of the 7 pull requests. The other 6 have no review record. Three were opened and merged by the same person’s account, two were opened and merged by the project’s automation account, and one was opened by an AI agent’s account and merged by a person’s account.A repository does not create review. It shows, change by change, whether one was recorded, and here it shows that ours mostly was not.
Why can sales add product lines to a deal?One permission line and one new row in the access table, 12 August 2026, pull request 8228, with the reason written down: sales users were refused on deals they otherwise fully owned.The answer is one line and one table row, with its reason attached. The reviewer signs a row in a table, not a block of code.
What if someone quietly removes that line today?The platform’s first check, which reads the files for mistakes, still passes, with a warning that every user who is not an administrator will be refused. The build stops and names the loss (below).In an app that keeps this table, removing a role’s access to a record type stops the build until a person regenerates the table. The check does not decide whether the change is right.
What if we accept the removal on purpose?Regenerating the table produces the table from before the August fix, exactly, character for character.Who-could-do-what is reproducible from the definition at any point in its history.

A formal review here means a review record on the pull request in GitHub: an approval, a request for changes, or a review comment.

The build’s refusal reads like this:

✗ Access matrix drift (1 change) — capability changes must be reviewed
• 'crm_sales_user' loses ALL access to 'crm_opportunity_line_item' (entry removed)
If intended, re-run with --update-access-matrix and commit the snapshot — its diff IS the review artifact.

In plain words: the sales role would lose all access to deal product lines, and the build will not finish until a person accepts that on purpose. The “access matrix” is the access table saved in the repository, one row per role and record type. The mechanism, line by line, is in How do you catch an AI’s silent permission change before it ships?

What the metadata platforms do better

The case for the established platforms is strong, and ObjectStack’s documentation makes it in its own words. What they are good at: “building business applications quickly on a proven runtime, with packaged apps, modules and integrations to start from.” Where they start ahead:

Salesforce, Odoo and ERPNext bring years of production use, packaged applications, app marketplaces and implementation partners. ObjectStack is younger; expect to build more of it yourself. — ObjectStack docs, “Where the others are stronger”

Three more points count in their favour:

If you already run on one of these platforms, what you have already built there is a real reason to stay, and our posts on Power Platform and Dataverse and on Retool weigh specific products.

How to choose

Start from a configuration platform when you need packaged apps, a marketplace and implementation partners this quarter; when the people changing the system are administrators working in its screens; and when your auditors accept the platform’s own change records.

Keep the definition in a repository when AI agents will write most of the changes and a person has to answer for each one; when a permission change must come with a reason and a readable before-and-after; and when you want the definition of your business to be files your company holds, not rows in a running system’s database. ObjectStack’s README puts that last point this way: “The definition lives in your repository as ordinary TypeScript, versioned in your VCS and reviewable as a diff — not a graph held inside a vendor’s system.” VCS is version control; TypeScript is the language the files are written in.

Whichever you pick, ask the vendor three questions:

  1. Which copy is authoritative: the running system or a file?
  2. Can I get every permission change as a readable before-and-after, with an author and a reason, before it takes effect?
  3. When the running system and the file disagree, which one wins, and who finds out?

What a repository does not solve

  • It does not decide whether a change is right. When we removed the August fix, the platform’s first check passed with a warning. Only the access table stopped the build, and only because this app has one: each app has to switch the table on, and an app without it would have built. A person still has to decide that sales should or should not touch product lines.
  • It does not create review. Six of the seven pull requests above have no review recorded on GitHub, ours included in that count: this is ObjectStack’s own repository. No record does not prove nobody read the change; it means nobody can show that someone did. The repository makes that gap countable. Closing it takes a setting that requires an approval before merging.
  • ObjectStack keeps some configuration too. Views, dashboards, reports, translations and email templates can be edited in the admin screen of a running environment. Those edits are stored in that environment’s database and take precedence over the repository’s version, with their own change log. Most kinds of definition, bundles of permissions included, can also be created at runtime through the programming interface. Those are configuration in exactly this post’s sense, so which changes must go through the repository is a policy you set.

Point your agent at the definition

A definition an agent can generate, with a fixed, checkable shape, that a person can review as a small diff and that the running system enforces: ObjectStack is one such target; point your agent at ObjectStack to try it on your own process. For the vocabulary, see the definition layer, application definition versus runtime, and what “the ontology is the software” means.

The proof

Everything above was measured on 2026-11-20 against ObjectStack 18.6.0.

$ npm view @objectstack/cli dist-tags.latest
18.6.0

The git counts read the objectstack repository at the tag @objectstack/[email protected] (commit 958ee03), on a full clone, not a shallow one.

1. The permission file’s history: 7 changes

$ T='@objectstack/[email protected]'
$ git log $T --format='%h %ad  %s' --date=short -- examples/app-crm/src/security/sales-positions.ts
9d313f3ac70 2026-11-06  refactor(examples): every example-authored metadata name carries its package namespace (#30927)
9975c26ae38 2026-10-18  docs(rest,app-crm): the public form submit is authorized by its declaration, not by a guest_portal set (#24237)
bfc15d275ba 2026-10-11  feat(spec,core)!: positions declare their permissionSets; the authorization resolver reads the security catalog and the activation ledger (#22723)
90718b6804e 2026-09-03  docs(app-crm): point two stale comments at the real consumers (#14840)
c4624f084f7 2026-08-12  fix(example-crm): grant crm_opportunity_line_item in crm_sales_user, matching its master crm_opportunity (#8164) (#8228)
0a8e68580eb 2026-07-10  feat(showcase,docs): ADR-0090 permission-model zoo + full docs alignment (#2739)
6d83431cfaf 2026-07-09  feat(security)!: ADR-0090 P1 breaking wave — position rename, profile removal, secure OWD default, principal/external spec shapes (#2697)

$ git log $T --oneline -- examples/app-crm/src/security/sales-positions.ts | wc -l
7
$ git log $T --follow --oneline -- examples/app-crm/src/security/sales-positions.ts | wc -l
15
$ git show -M --format= --name-status 6d83431cfaf | grep sales-
R088	examples/app-crm/src/security/sales-roles.ts	examples/app-crm/src/security/sales-positions.ts
$ git log $T --oneline -- examples/app-crm/access-matrix.json | wc -l
2

The count is for the file under its current name. It was renamed from sales-roles.ts in the first of the seven; git log --follow reaches 8 earlier commits, back to 27 May 2026. The 6 November change, #30927, renamed the names inside the file, not the file. The access table has two commits: a5a1e41ba89 (2026-07-09) created it, and c4624f084f7 (2026-08-12) is the fix below.

2. AI co-authorship and pull requests

$ for c in $(git log $T --format=%h -- examples/app-crm/src/security/sales-positions.ts); do
>   git log -1 --format=%B $c | grep -qi 'co-authored-by: claude' && echo ai || echo other; done | sort | uniq -c
      7 ai

$ git log $T --since=2026-07-01 --format=%H -- examples/app-crm/src | while read c; do
>   git log -1 --format=%B $c | grep -qi 'co-authored-by: claude' && echo ai || echo other; done | sort | uniq -c
     49 ai
      1 other

$ git log $T --format=%H -- examples/app-crm/src | while read c; do
>   git log -1 --format=%B $c | grep -qi 'co-authored-by: claude' && echo ai || echo other; done | sort | uniq -c
     71 ai
    147 other
$ git log $T --reverse --format=%ad --date=short -- examples/app-crm/src | head -1
2026-02-03

$ git log --first-parent $T --since=2026-07-01 --oneline -- examples/app-crm/src | wc -l
50
$ git log --first-parent $T --since=2026-07-01 --oneline -- examples/app-crm/src | grep -v '(#[0-9]*)'
df1137309d0 Merge pull request #2624 from objectstack-ai/claude/metadata-showcase-redesign-ougiov

A co-author line records that the tool took part in the change, not how much of it the tool wrote. --since filters on the commit date; the earliest commit in the window is from 5 July 2026. All 50 changes to the CRM example’s source files in that window reached the main branch through a pull request: 49 as squashed pull requests whose subject carries the number, and one inside the merge of pull request 2624. The one change without the co-author line is 23430995bcf (#3806).

3. Review records on the 7 pull requests

$ for n in 2697 2739 8228 14840 22723 24237 30927; do
>   r=$(gh api repos/objectstack-ai/objectstack/pulls/$n/reviews --jq length)
>   gh api repos/objectstack-ai/objectstack/pulls/$n --jq "\"$n reviews=$r opened-by=\(.user.type) merged-by=\(.merged_by.type) same-account=\(if .user.login == .merged_by.login then \"yes\" else \"no\" end)\""
> done
2697 reviews=0 opened-by=User merged-by=User same-account=yes
2739 reviews=0 opened-by=User merged-by=User same-account=yes
8228 reviews=0 opened-by=User merged-by=User same-account=yes
14840 reviews=0 opened-by=Bot merged-by=User same-account=no
22723 reviews=1 opened-by=Bot merged-by=Bot same-account=yes
24237 reviews=0 opened-by=Bot merged-by=Bot same-account=yes
30927 reviews=0 opened-by=Bot merged-by=Bot same-account=yes

The one review record, on 22723, is an approval. Counted by kind, the six without one: three opened and merged by the same person’s account (2697, 2739, 8228); two opened and merged by the project’s automation account (24237, 30927); and one opened by an AI agent’s account and merged by a person’s account (14840). The automation account and the AI agent’s account are two different bot accounts; the command prints account types rather than names, and dropping the type lookups shows the accounts themselves.

4. The August change: one line, one table entry

$ git show c4624f084f7 --stat --format='%h %ad%n%n%b' --date=short | sed -n '1,14p'
c4624f084f7 2026-08-12

* fix(example-crm): grant crm_opportunity_line_item in crm_sales_user, matching its master crm_opportunity (#8164)

crm_opportunity_line_item is a master-detail CHILD of crm_opportunity
(sharingModel: 'controlled_by_parent', inlineEdit: 'grid' on the
Opportunity form), but crm_sales_user granted object-level CRUD on 5
CRM objects and never the line item. Record-level access always
follows the master (ADR-0055), but object-level CRUD is a SEPARATE
gate the platform never derives -- every role-bound (non-admin) user
got a silent 403 the moment they tried to add/edit a product line on
an Opportunity they otherwise fully own. The platform's own
build-time lint (security-master-detail-ungranted) already flagged
this independently.

The change to the definition, with the five unchanged lines that were only re-spaced left out:

     crm_opportunity: { allowRead: true, allowCreate: true, allowEdit: true, allowDelete: false },
+    // [#8164] crm_opportunity_line_item is a master-detail CHILD of
+    // crm_opportunity (sharingModel: 'controlled_by_parent') — ...
+    crm_opportunity_line_item: { allowRead: true, allowCreate: true, allowEdit: true, allowDelete: false },
     crm_lead: { allowRead: true, allowCreate: true, allowEdit: true, allowDelete: false },

And the entry it added to examples/app-crm/access-matrix.json, which is still there at the 18.6.0 tag:

+    {
+      "permissionSet": "crm_sales_user",
+      "object": "crm_opportunity_line_item",
+      "create": true,
+      "read": true,
+      "edit": true,
+      "delete": false,
+      "viewAllRecords": false,
+      "modifyAllRecords": false,
+      "sharingModel": "controlled_by_parent"
+    },

5. Undo it on 18.6.0

The CRM example from the tag, installed against the published 18.6.0 packages rather than the monorepo (its workspace:* dependencies set to 18.6.0, its test folder left out), and committed to a scratch repository so the edit can be shown as a diff:

$ git -C ~/objectstack archive '@objectstack/[email protected]' examples/app-crm | tar -x --strip-components=2
$ npm install
$ npx os --version
@objectstack/cli/18.6.0 linux-x64 node-v22.22.0
$ npx os compile; echo $?
  ...
  → Checking access-matrix snapshot (ADR-0090 D6)...
  ...
  ✓ Build complete (270ms)
0

Remove the one grant line, then run the check and the build:

$ sed -i '/^    crm_opportunity_line_item: { allowRead: true/d' src/security/sales-positions.ts
$ git diff --stat
 src/security/sales-positions.ts | 1 -
 1 file changed, 1 deletion(-)

$ npx os validate; echo $?
  → Running author-time rules (71)...
  ...
  ✓ Validation passed (374ms)
  ...
  ⚠ object "crm_opportunity_line_item": detail object "crm_opportunity_line_item" (master_detail "opportunity" → "crm_opportunity") has no object-level CRUD grant in any permission set, so non-admin users are denied it (403)
    fix: Grant it where its master "crm_opportunity" is granted: permissions[i].objects.crm_opportunity_line_item = { allowRead: true, allowCreate: true, allowEdit: true }
    rule: security-master-detail-ungranted  at objects[5].fields.opportunity
  ...
0

$ npx os compile; echo $?
  → Running author-time rules (71)...
  ...
  → Checking access-matrix snapshot (ADR-0090 D6)...

  ✗ Access matrix drift (1 change) — capability changes must be reviewed
  • 'crm_sales_user' loses ALL access to 'crm_opportunity_line_item' (entry removed)
  If intended, re-run with --update-access-matrix and commit the snapshot — its diff IS the review artifact.
1

The table is opt-in per app. The 18.6.0 build source says so where it runs the check: “Opt-in per app: when access-matrix.json sits next to the config”.

6. Accept the removal on purpose

$ npx os compile --update-access-matrix; echo $?
  → Access matrix snapshot written to access-matrix.json (ADR-0090 D6) — review the diff.
  ✓ Build complete (353ms)
0
$ git diff --stat
 access-matrix.json              | 11 -----------
 src/security/sales-positions.ts |  1 -
 2 files changed, 12 deletions(-)

$ git hash-object access-matrix.json
ecfe192469fc5500deecb0924d20699a382d6b45
$ git -C ~/objectstack rev-parse c4624f084f7^:examples/app-crm/access-matrix.json
ecfe192469fc5500deecb0924d20699a382d6b45

The regenerated table is the same file, byte for byte, as the table before the August fix. The scratch tree was then restored with git checkout HEAD -- ., and git diff HEAD was empty.

7. The lines quoted, at the 18.6.0 tag

  • content/docs/concepts/compare.mdx lines 58–73 (the closest relatives, what they are good at, the difference) and lines 115–117 (where they are stronger).
  • content/docs/automation/hook-bodies.mdx line 61 (the standard low-code shape).
  • README.md lines 197–199 (the definition lives in your repository).
  • content/docs/concepts/metadata-lifecycle.mdx line 43 (“Reads walk top-to-bottom: the first non-null layer wins”) and line 342 (a console edit is written as an overlay row, with a history row in the same transaction).
  • packages/spec/src/kernel/metadata-plugin.zod.ts line 348 (“Allow runtime creation via API”) and the type registry below it: the console overlay is on for view, dashboard, report, translation and email_template, and off for permission, position, object and flow.