News for hackers. Stuff that matters.
Re:HSBC moves from 65 relational databases into one global M... by blablabla123 on Saturday June 13, 2020 @06:21AM (#23508399)
Transactions in bank accounts are actually not realized through DB transactions. It's easily visible if you ever had a failing payment: the amount gets subtracted but added again right away after that. They have pretty strong auditing requirements.
Re:HSBC moves from 65 relational databases into one global M... by brainless on Saturday June 13, 2020 @07:01AM (#23508601)
What has "amount gets subtracted but added again right away after that" have to do that with DB transactions?

Basically each Banking transaction is an immutable log, which can easily reside in a DB with DB transactions feature. They are not related.

Can you please elaborate in technical terms what you mean?

Re:HSBC moves from 65 relational databases into one global M... by willcipriano on Saturday June 13, 2020 @08:20AM (#23508883)
Not the OP but I think it's essentially a event driven system as opposed to real time.

Think of a account with $0 in it.

1. A -$25 event comes in

2. A +$50 event comes in

3. A -$25 event comes in

The first event would fail in a transactional/real time system, but in my bank it doesn't. This tells me the balance is only calculated every once in a while. The balance you get in a app is only a estimate.

This makes sense when you think how slow bank transfers and using paper checks is. At some point it is decided to run the events "for real" and that's where overdrafts and the like are applied.

Don't think of them as transactions, instead it's a transaction request that can be rejected.

Re:HSBC moves from 65 relational databases into one global M... by lscharen on Saturday June 13, 2020 @09:10AM (#23509122)
Related to this — Wells Fargo was sued[1] (and lost) around 2010 for the practice of ordering daily transaction to (indirectly) maximize fees and penalties.

In your example, a “good” bank would order the transactions: +$50, -$25, -$25 resulting in a zero balance with no penalties. What Wells Fargo did could result in the transactions being ordered as: -$25 (overdraft), -$25 (overdraft), +$50.

Each overdraft could charge a fee up to $35, leaving the account holder with a -$70 balance.

[1] https://www.latimes.com/nation/la-fi-court-bank-overdraft-fe...

Re:HSBC moves from 65 relational databases into one global M... by alexchamberlain on Saturday June 13, 2020 @12:05PM (#23510389)
Seems much simpler only to charge fees at the end of the day...
Re:HSBC moves from 65 relational databases into one global M... by eqvinox on Saturday June 13, 2020 @01:06PM (#23510860)
Unfortunately, the optimization goal for commercial entities generally is maximum money extraction, not simplicity :)
Re:HSBC moves from 65 relational databases into one global M... by kenniskrag on Saturday June 13, 2020 @10:09AM (#23509442)
It depends on the country and currency but there is the SWIFT system, which works like messaging. There is also the SIC and EuroSIC. For SWIFT system as a bank you have an account on the other bank and sends an instruction to decrease your amount and book it to a receiver. If there are more than one bank between them it gets routed but always "own decrease and other bank increase". Only the receiver bank books to the client. This system works because every bank has an account on other banks and you can build up some paths.
Re:HSBC moves from 65 relational databases into one global M... by bouncycastle on Saturday June 13, 2020 @08:47AM (#23508997)
Sure, it just means that the processing is done in a batch job at the end of the day. However, it doesn't mean that the batch jobs don't use a database. There's probably something like db2 on the mainframe, possibly even COBOL or RPG
Re:HSBC moves from 65 relational databases into one global M... by sohamsankaran on Saturday June 13, 2020 @08:58AM (#23509053)
Yep, it's pretty clear they use IBM db2 on z/OS internally for some applications. Here's an example job posting: https://webcache.googleusercontent.com/search?q=cache:Aqb9oU...
Re:HSBC moves from 65 relational databases into one global M... by tigershark on Saturday June 13, 2020 @09:14AM (#23509145)
How slow bank transfers are? Is 2 seconds really that slow?
Re:HSBC moves from 65 relational databases into one global M... by willcipriano on Saturday June 13, 2020 @09:30AM (#23509220)
In the US they clear overnight, as I understand (from a previous hn post I can no longer find) it's a big sftp server and flat files.
Re:HSBC moves from 65 relational databases into one global M... by nobleach on Saturday June 13, 2020 @10:22AM (#23509528)
Working in the fintech has opened my eyes to how many shortcomings there really are in banking/ACH. What you describe above is both my nightmare, and my reality. Pipe-delimited flat files being SFTPed via cronjobs overnight. Getting the emails at 5am that balances are off/not reconciled because somehow an errant '|' got into the mix.

Additionally, the number of folks that ask for spreadsheets (not encrypted) with your SSN... and then proceed to email that data around (sometimes via Gmail!)

Re:HSBC moves from 65 relational databases into one global M... by tigershark on Saturday June 13, 2020 @01:18PM (#23510963)
The article is about HSBC, a British bank, where the transfers happen in a matter of seconds. What is the point of comparing it with US banks?
Re:HSBC moves from 65 relational databases into one global M... by attilakun on Saturday June 13, 2020 @09:18AM (#23509162)
I could be wrong but I think the following scenario is worth considering. Let's say a client wants to transact money from bank A to bank B. The following steps are taken:

1. Client initiates the transfer request.

2. Bank A decreases the client's balance.

3. Bank A sends the request to transfer money to bank B.

Now, I guess you would expect that steps 2 and 3 should form part of a DB transaction. This however does not really work because it is unclear what conclusion we should draw from step 3 failing. On one hand, it is possible that the request failed on its way to bank B, in which case step 2 should not be applied. On the other hand, it is possible that the request successfully reached bank B but the response got lost on its way back. In this case step 2 should be applied.

Therefore, not treating steps 2 and 3 as a single transaction makes sense if you want to take a conservative approach that does not allow for accidental transfer of infinite amounts of money to bank B in scenarios when the response fails to come back from an otherwise successful transfer.

Re:HSBC moves from 65 relational databases into one global M... by samus on Sunday June 14, 2020 @06:31AM (#23516566)
We have exactly the same problem at work. One possible way to solve it is by ensuring that the receiving system treats the request as idempotent. One could also poll first at the receiver whether the transaction exists, and then send it if it doesn't. But both measures require that there is a way to uniquely identify a request. Also, idempotency can be annoying to implement correctly. Thus, implementors might try to wiggle their way out of it, technically or politically.
Re:HSBC moves from 65 relational databases into one global M... by nurettin on Saturday June 13, 2020 @06:37AM (#23508486)
This is the only comment worth a thing here. Unless mongodb causes irrevocable data loss, eventual consistency is easily mitigated using an accounting service. I have seen one of them at work. Transaction amount comes in, it is compared with initial value and the session is kept open until the quantity is fulfilled. If there is a timeout, secondary systems try to recover or alert. Recovery can even deduct overfills or complete fills.
Re:HSBC moves from 65 relational databases into one global M... by zo1 on Saturday June 13, 2020 @07:44AM (#23508754)
This seems ridiculously complicated and unnecessary for something that should be as easy as having a proper RDMS that is ACID compliant. I guess now we have one additional reason why banking has stagnated for so long.
Re:HSBC moves from 65 relational databases into one global M... by kilburn on Saturday June 13, 2020 @08:37AM (#23508962)
Just in case you (or someone else) don't know why you are being downvoted, I'll give you a few reasons:

- Banks have to put these double-checking and reporting systems in place because the law mandates them to. No amount of ACID compliance in your database is freeing you from that.

- These requirements are not stupid either: assuming you had a perfect system with perfect ACID compliance and 0 bugs ever (which we all know is impossible), a random hardware failure (or cosmic ray) can flip a bit somewhere and you are screwed.

- Your comment reads as extremely condescending, which is never good to get your point across.

- Not only that, but you dismissed the work of some of the best people money can buy in two sentences with 0 rationale. Next time you think you know better than an entire extremely well funded industry, think again, and again, and again. If you are still convinced you know better, please open shop because if you are right you'll not just make yourself the next self-made billionaire, but also probably improve our lives in the process.

Re:HSBC moves from 65 relational databases into one global M... by matt_d_rat on Sunday June 14, 2020 @08:25PM (#23522659)
This comment gives me hope that there are at least some decent people on Hacker News.

Every time I read an article here I am put off from participating further because the comments are usually filled with toxic spew from peacock fan boys Who think they know better.

You have my up vote.

Re:HSBC moves from 65 relational databases into one global M... by nurettin on Saturday June 13, 2020 @08:29AM (#23508926)
It is complicated, but necessary. You will get to the ridiculous part once you realize that executing brokers don't care about your acid guarantees or whatever.
Re:HSBC moves from 65 relational databases into one global M... by zo1 on Saturday June 13, 2020 @09:09AM (#23509115)
Thanks for the info - I didn't realize we were discussing distributed transactions with external brokers/banks.
Re:HSBC moves from 65 relational databases into one global M... by KptMarchewa on Saturday June 13, 2020 @01:37PM (#23511108)
Banking is integrations with literally hundreds different external systems.
Re:HSBC moves from 65 relational databases into one global M... by DonHopkins on Saturday June 13, 2020 @02:40PM (#23511599)
Are we discussing HSBC bankers or Silk Road LSD dealers?
Re:HSBC moves from 65 relational databases into one global M... by nurettin on Sunday June 14, 2020 @06:50PM (#23522081)
I suspect ACID doesn't help either of them.