Where is Daml database & script result?

Hi, i just start Daml. I am confused by Daml’s database. I don’t see any code which have the connection. And i read that can connect Daml database to other database such as postgres. Where can i read docs about it?

Look forward this topic! Best wishes!!!

Daml isn’t a database itself. Take a look at this chart. Some points of interest (please look at the chart to follow along):

  1. The Participant Node is most of what you’ll see in our Scala code in terms of actually implementing the ledger model and semantics, coordinating contract creation and exercise, checking authorization, actually interpreting Daml-LF code, &c. However, it does not have any form of storage itself. Instead,
  2. the Persistence Infrastructure is where contracts and transaction history is stored. Postgres is an example of this.
  3. You’ll note that the Participant Node interacts with the Persistence Infrastructure via a Daml Driver. This is the sort of thing you’ve seen that

with the caveat that there’s no “database” except for e.g. postgres.

I recommend checking the Ecosystem Overview for more details on these components.

3 Likes

Thank u so much! U make me clear!

Hi Stephen, i have a problem: how can i see Persistence Infrastructure history where contracts and transaction history is stored? And how is the history protected from editing?
Look forward from u!

Sincerely,

Take a look at the replies by @drsk and @bernhard in this forum post for more explanation on how to think about and work with persistence infrastructure (referred to there as “ledger” or “underlying ledger”).

This is addressed properly in the post I linked, but to put it briefly, a Daml deployment has the properties of the underlying ledger (persistence infrastructure). If you want your ledger to have particular features, you have to choose a persistence infrastructure that has those features; Daml cannot transmute those features to all of its supported drivers.