Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why you should not use nosql for financial transaction

I heard from a speaker at a Hackaton event organized by a bank that you should not use nosql for financial transaction for security reasons. But I have no idea what he's saying. I have been looking for an answer as to why I should not use nosql database in my application.

What are the pros and cons of nosql, and what are the pros and cons about sql databases for financial transaction?

Now, I'm building an application for shop cashier, where the cashier will use this app to store transactions, receive orders, and receive payments with Cash or Credit Card.

What is the best possible approach for this project's API? SQL or NoSQL, and why?

like image 646
fadeltd Avatar asked Mar 21 '17 04:03

fadeltd


People also ask

Why NoSQL is not good for transactions?

They lack support for complex queries such as joins across tables. While relational databases rely heavily on normalization and referential integrity, NoSQL databases are not strictly normalized. Generally, NoSQL databases do not implement multi-key transactions.

Why is NoSQL not preferred for financial data?

NoSql DBs are for unstructured or semi-structured data which obviously do not support transactions. There is one major drawback of NoSQL is lacking data consistency. Data should be consistent while making payments and should follow db transactions for data reliability. This is possible only within the RDBMS.

Is NoSQL good for transactional data?

Generally speaking, NoSQL solutions have lighter weight transactional semantics than relational databases, but still have facilities for atomic operations at some level. Generally, the ones which do master-master replication provide less in the way of consistency, and more availability.

What are the disadvantages of NoSQL?

What are the drawbacks of NoSQL databases? One of the most frequently cited drawbacks of NoSQL databases is that they don't support ACID (atomicity, consistency, isolation, durability) transactions across multiple documents. With appropriate schema design, single-record atomicity is acceptable for lots of applications.


2 Answers

AS explained by @A2H, the SQL and NoSQL depends on your requirements, saying that NoSQL is not secure is not accurate, this is like saying that SQL is not scalable... which is not true either.

Now, for a financial application you will have some non-functional requirements that I can list below:

  • Secure at file level: if someone has access to the database file will they be able to use this to load the information somewhere else? for example, in SQL Server the login information about the db is included in the files, therefore copying the files without the password will make hard for hackers to steal information.
  • Scalable: How much,are we talking about? some millions records? Scalable in what sense, do you require to do distributed queries or just localized databases depending on the region and central tables for accounts info? or are you planning to create an application that will receive tons of records per second (like forex information) and therefore you need something to ingest tons of records and analyse results? in that case maybe NoSQL is for you.
  • Transaction (ACID) complaint: Are you handling transactions (like the type of debit this credit this other?) then you might need to use something like Djondb or traditional RDBMS, both support transactions.
  • Flexible schemas: You need a flexible schema that can adapts to your frequent changes without having to redesign your database and updating previous records? NoSQL is good at this.

the list will continue... but I think you get the idea...

Saying that NoSQL is un-secure is an overstatement, as any other generalisation.

like image 129
Cross Avatar answered Nov 16 '22 02:11

Cross


SQL and NoSQL databases are not interchangeable. There's no silver bullet database technology. You should consider pros and cons when choosing what database technology you want to use for your project.

Short answer: If you need to process transactions, your data can nicely be arranged in relational entities then use SQL. If you need to handle large volumes of semi-structured or unstructured data, and need horizontal scalability, then use NoSQL.

If you want to read more about differences between SQL and NoSQL click here or here.

Some insight on when to use SQL or NoSQL can be found here.

like image 36
ahoxha Avatar answered Nov 16 '22 02:11

ahoxha