Giter VIP home page Giter VIP logo

Comments (2)

ar avatar ar commented on June 28, 2024 1

It's actually intended behavior. The BalanceCache doesn't intend to be synchronized with the very latest transaction for a given account at a given journal for a given set of layers. It's totally OK for miniGL to read a bunch of transaction entries (in the hundreds) to get the actual balance of a given account. That's very fast and performed by a database native query (on supported database).

The basic idea behind the BalanceCache is to prevent having to start for the very beginning of transentries and having to scan in some situations thousands of records.

We've choose the safe window value of 1000 because on heavy loaded systems, that's usually just a few seconds/minutes away from the latest transaction, and prevents some race conditions for in-flight transactions.

It was a mistake (my fault) to expose the balance caches as a public method of GLSession. It's actually a miniGL internal thing. Today we use the BalanceCache, tomorrow we could use something else, what we want is to provide fast balances. Something similar happens with CheckPoints. I hope to correct that design fault in future versions (and actually have some ideas in mind that I'm experimenting in PoC).

from jpos-ee.

nalasra avatar nalasra commented on June 28, 2024 1

Thanks for the great explanation. It all makes sense now.

from jpos-ee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.