18
votes
Accepted
Are bank transactions run with DB transactions?
Bank transactions are based on Double-entry bookkeeping.
That means that account balances are derived, not stored or manipulated directly.
Basically, every transaction is stored as a record saying "...
12
votes
What are some approaches used in financial applications to prevent deposit/withdrawal sync problems?
Transactions
A transaction wraps all of the required steps for a particular business operation and guarantees that either all of the steps succeed or they all rollback to the original state in the ...
9
votes
Accepted
How are account balances persisted
Most commercial accounting software store the account balance, sometimes with the account, but most often in periodic tables (per year or per month).
The technical point of view
There are several ...
7
votes
Are bank transactions run with DB transactions?
"The real world of multi-business financial transaction processing" is always that there are many entirely-disconnected systems in place. "SQL transactions" therefore can never cover this.
5
votes
Accepted
Loan Amortization Schedule - Precision and rounding
This is not a rounding error, but a wrong application of financial formulas.
The formula used for your loan payment is based on financial math designed for a periodic payment with an interest ...
4
votes
Accepted
Designing distributed invoice number counting system
Indeed, many countries around the world, enforce a legal requirement to use sequential numbering for invoices. The aim is to reduce tax fraud: non-reported invoices (potential tax evasion) are easy ...
4
votes
Designing distributed invoice number counting system
You can't distribute an incremental counter practically by definition. (as Steve points out) And as you point out there is a legal requirement for invoices to have an incrementing counter.
However, I ...
4
votes
Accepted
BigDecimal for Calculation with and Display of Stock Shares and Prices?
No double will not meet your needs.
If it wasn't for needing to do calculations String would best meet your needs.
That leaves BigDecimal. It calculates slower than double but it will faithfully ...
3
votes
Accepted
How to handle events representing cross-domain knowledge
Typically, accounts payables and account receivables are sub-ledgers in the accounting context. They register accounting transactions with vendors and customers.
Accounting transactions with vendors ...
3
votes
How are account balances persisted
If by "persisted" you mean "stored into a (not necessarily relational) database", then in general you shouldn't store derived values along with the primary values. This is called denormalization and ...
3
votes
Accepted
Network Topology for ATM and POS Systems
OK here goes for the quick explanation on a very complex subject.
Before we start you should be aware that the basic technologies date back
to the 1980s where the processing and network technologies ...
2
votes
Is there a better approach for mass balances processing
There is really not enough information to answer this question because it depends on an understanding of the worst-case latency requirement, which is not supplied in the question, and would be ...
2
votes
How to automate certains tasks in a web application?
Nothing in your requirements suggests that you need to have a batch run every day. Instead, you need to be able to compute a customer's balance at the moment it is needed: when the user requests his ...
2
votes
What are some approaches used in financial applications to prevent deposit/withdrawal sync problems?
Locks and transactions are not really necessary to deal with such simple cases.
You can combine the checking and the update in a single step (or statement in the SQL jargon), guaranteeing an atomic ...
2
votes
Accepted
Algorithm for calculating daily profits from user's balance minus deposits
In order to answer your question, you need to model more precisely your domain:
If you just compare the daily balance of the account, you will find a 110% increase. But that's not a profit, it's a ...
2
votes
How to handle events representing cross-domain knowledge
Disclaimer
For the purpose of the explanation, it's irrelevant whether we consider these bounded contexts as part of the same monolithic runtime or if they're completely separate microservices, their ...
2
votes
Accepted
How to create financial reports with detailed information
The idea of your third approach is a step in the right direction:
Store the total of the account, for example, at the end of each month, as an additional datum.
Now to address your concerns:
After ...
2
votes
Handling Back-dated Transactions and "Online" Transactions on ERP/Banking Systems
It's a great question, and one that reveals many of the subtleties about banking that we rarely see here.
I can't answer all the questions, but I can say something on a couple which involve ...
1
vote
More efficient FIFO inventory calculation?
In short
The main challenge in your requirement is the uncertain sequence of outgoing orders, which could arbitrarily change the price. Several financial constraints forbid this to happen in some ...
1
vote
Design patters for handling invoice "payment_status" when split payments are involved
Most important: It’s up to management to decide the rules.
A major organisation where I once worked had this rule: if a payment matches one, two or three bills exactly then it is applied to those ...
1
vote
How are account balances persisted
If you check you bank statements you'll see the first line is usually 'balance carried over from previous month'
I suggest you implement a similar 'snapshot' system, where you roll up previous ...
1
vote
What are some approaches used in financial applications to prevent deposit/withdrawal sync problems?
The term you're looking for is "consistency" (or lack of).
For real enterprise SW, you would need several patterns to fix this
Transactions (plain old transactions).
Use either Atomic Updates, or ...
1
vote
What are some approaches used in financial applications to prevent deposit/withdrawal sync problems?
Consistency
With Cassandra or generally and distributed database this is a problem of 'consistency' and 'eventual consistency'. With eventual consistency the accuracy, or reads going out of your db, ...
1
vote
How to automate certains tasks in a web application?
Programs are good doing repetitive jobs.
Instead of scheduling tasks on a precise date and moment, try scheduling 3 periodic tasks.
Task 1: Accounts about to expire
Let's say this task is executed ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
financial × 35design × 4
database-design × 4
php × 3
database × 3
java × 2
design-patterns × 2
algorithms × 2
web-development × 2
programming-languages × 2
open-source × 2
domain-model × 2
business × 2
transaction × 2
billing × 2
c# × 1
architecture × 1
object-oriented-design × 1
domain-driven-design × 1
licensing × 1
api × 1
agile × 1
security × 1
performance × 1
multithreading × 1