Bottlenecks and trade-offs
How can “document calculation leaves the lock scope” be proven in the specific case?
A large document list extends the approval transaction.
Starting point The repeated call reads the stored approval result.
Assumptions for the example case
Fictitious design for a house, a completed annual period and a contractually specified area key. The application documents released billings and correction versions; the legal examination of individual costs remains with property management. All quantities, thresholds and operational targets are illustrative assumptions. The signed amount due equals the allocated cost share minus advance payments already accounted for. A separate immutable payment ledger records only additional positive payments received later. Outstanding balance = current amount due minus the sum of these additional payments. A positive balance is the remaining amount due, zero means settled, and a negative balance is a credit equal to its absolute value. Corrections replace the amount due, retain all payments and post only the difference from the previous amount due. They remain permitted after settlement and for credit balances. Actual positive payments are accepted and deduplicated even when they exceed the remaining amount due or arrive after settlement. Advance payments are not counted again in the additional ledger. Refunds are outside this case; a credit documents a balance and does not receivable a payout.
Locate lock contention
Differentiate measurement tree · blocking time and document calculation
The measure follows the measured branch. Precalculation remains bound by manifest hash and version comparison to the current status.
From symptom to targeted action
| Signal | Validation | Action and limit |
|---|---|---|
| Waiting for release | Measure blocking time per billing and document reading time separately | Calculate documents before the transaction; check only the manifest and version at commit. |
| The portal is slow | Compare document download against release latency | Deliver shared files separately; rights check remains upstream. |
Waiting for release
- Validation
- Measure blocking time per billing and document reading time separately
- Action and limit
- Calculate documents before the transaction; check only the manifest and version at commit.
The portal is slow
- Validation
- Compare document download against release latency
- Action and limit
- Deliver shared files separately; rights check remains upstream.
Move document calculation outside the lock scope.
The application calculates in advance and checks the manifest hash and version at commit time.
A large document list extends the approval transaction.
Measurement separates computing time and blocking waiting time so that the measure meets the actual bottleneck. If the manifest changes between preparation and commit, the release is rejected; the faster calculation does not lower a consistency requirement.
- Alternative considered
- Precalculation without re-comparing versions assumes outdated costs.
- Trade-off
- Obsolete pre-calculations are discarded and recreated.
- Reassess
- Frequent faults speak for separate processing windows per house.
Try it yourself
A preliminary calculation uses document manifest H1. Before the approval commit, it will be replaced by H2. Decide on the release and name two readings that help explain a slow release.
A hint for your attempt
Track the released billing up to the documented result; take note of the measurement before the change.
Compare with a possible solution
- Manifest conflict
- The commit compares the prepared hash with the current manifest. H1≠H2 leads to rejection and recalculation instead of releasing an outdated cost level.
- Targeted measurement
- Measure document calculation time and lock waiting time separately. Move lengthy calculations before the transaction; shorten transactions when lock waits dominate. Both changes retain the final manifest comparison.
Apply to your project
What decision do you need in your project for a measurable scaling limit?