Currently, protokit considers all database operations to be part of one single atomicity unit.
However, in reality we use Redis and Prisma concurrently for different parts of the data store and those are obviously in different atomicity and isolation units, i.e. we can't enforce atomicity in both at the same time. In the codebase however, we do it exactly like this (we nest the one transaction API inside the other).
To fix this, we need to separate the following things:
- Database (State, Blocks, Transactions, ...)
- Trees
In the codebase, they will have the following modules (generate by some UX-enhancing collection module like PrismaRedisDatabase)
Currently, protokit considers all database operations to be part of one single atomicity unit.
However, in reality we use Redis and Prisma concurrently for different parts of the data store and those are obviously in different atomicity and isolation units, i.e. we can't enforce atomicity in both at the same time. In the codebase however, we do it exactly like this (we nest the one transaction API inside the other).
To fix this, we need to separate the following things:
In the codebase, they will have the following modules (generate by some UX-enhancing collection module like
PrismaRedisDatabase)DatabaseTreeDatabase