Node.js for real-time app, that involves bank accounts? Is recommended?

1,204 views
Skip to first unread message

Dave Clements

unread,
Jul 12, 2012, 6:30:32 PM7/12/12
to nod...@googlegroups.com
When it comes to finance, SQL comes out on top - things like MySQL have been battle tested for decades, accounts information is intrinsicly relational so relational databases are the right fit, ACID compliance with nosql is more liberal but with your project you'd need 100% reliability.

Also theres transactions and atomic operations, which strictly couple two entries to ensure that if you debit one place, you credit another place. NoSQL doesn't have the same level of capabilities.

If you'd asked for something super fast, pleasant and exciting to use, its nosql all the way. But for finance, SQL.

Stewart Mckinney

unread,
Jul 12, 2012, 9:29:04 PM7/12/12
to nod...@googlegroups.com
When you have highly structured data with high levels of interdependence, such as lots of numbers that all depend upon one another - i.e bank accounts - you use SQL.

When you have fairly unstructured, loose data that is fairly independent, such as content - i.e you are building a blog or  another Pintrest - use NoSQL.

Its all about the data.

Don't be afraid to use both, however. It doesn't sound like your application has much use for NoSQL, but if you have a blog section or something of that nature, consider it. NoSQL really shines in conditions where you have changing content needs.



--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Micheil Smith

unread,
Jul 13, 2012, 6:29:59 AM7/13/12
to nod...@googlegroups.com
Hi Eysenck,

You may not want to use Node.js (or any javascript vm) for this, due to the inherent issues
javascript has dealing with fractional numbers, for instance, take the classic expression:

"0.3 - 0.2 != 0.1"

However, as this is a financial application, you'd probably be storing currency as an integer,
not as a float, so you wouldn't have this issue. (ie, store all currency in the lowest fractional,
so $19.35 is stored as 1935).

As for choosing your web framework, you'll definitely want to make sure that the framework
is either battle tested or built to a good standard (ie, it'd suck if you had mass-insertion issues
in your DB, or if your app crashed and you lost all state of accounts.)


So, the TL;DR; of this is: You could probably use node.js + express for this, but, you'll want to
make sure you know node.js first, before jumping down this chasm. You may just be better off
using the stack of technologies you already know.

Kind Regards,
Micheil Smith
--
BrandedCode.com

On 12/07/2012, at 8:22 PM, Eysenck Gómez wrote:

> Hi, I'm a bit new here, I have in mind to make a real-time application on that involve money and bank accounts, and was thinking of using Node.js + Express + Now.js any SQL database or NoSQL, the problem I have no information on how safe or good is Node in this field, any of you have used Node.js applications of this kind?, I care much about security as we are talking about money, but everything is hackable I need something solid and secure, and as Node.js is a bit new, I wanted to know if I recommend and if so, which database would be good for this type of application? NoSQL or SQL? Thank you for your help.

Jeff Barczewski

unread,
Jul 13, 2012, 11:09:29 AM7/13/12
to nod...@googlegroups.com
If you want to get around the rounding errors with javascript then you need to work in cents (or even hundreths of a cent for more accuracy). 

So basically multiply your currency like dollars by 100 to get it into cents, do your calculations, then finally, divide by 100 or simply sprintf to display in dollars

By using non-fractional numbers, the javascript IEEE 754 floating point operations are exact.


Alternatively you could try a decimal or BigNumber implementation in javascript, a couple are mentioned in http://stackoverflow.com/a/3439981

Jeff
Reply all
Reply to author
Forward
0 new messages