Click here to Skip to main content
15,906,558 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Dear Friends:

Should I use ADO.net or a binary file for creating a bank of information?

from the view of security, size, encryption and easy access of each record


Yours
Posted
Updated 17-May-12 7:35am
v2
Comments
Sergey Alexandrovich Kryukov 17-May-12 13:56pm    
Not enough information for a 100% definitive advice. Short answer is: it depends, but please see my answer below.
--SA

With database you have:
- good security
- standard tools to access and present your data
- good speed
- easy dealing with concurrency
- it depend on the DBMS you choose:
-- the size of the database file
-- the amount of dll's you need to add
-- if you need real server, or you have "embedded" server
-- encryption you can use (if supported)
With binary file you have:
- full control over how data is stored, thus over the size of the database
- smaller deliverables (if not a mobile app, who cares about this nowadays?)
- you have to code everithing from data access, encryption to presentation
- high speed (if you do it right)
- hard to maintain
- you have to reinnvent the wheel

So: I suggest you use an SQL server. If you need no standalone real server and real concurrency, look for embedded editions. If you need encryption you could find editions that support it (but maybe without .net provider), or you can use some encryption on field level. But be aware that .net applications are easier to "dissassamble" than native code was.
 
Share this answer
 
Comments
Mmohmmad 17-May-12 13:56pm    
Dear Zoltan:

Thanks for your nice and detailed answer. Honestly, I was impressed.

I have a bank such as notes of a book like language book and I want to create a bank from it with string piic sound and video with windows application.
Now what is your suggestion?
Zoltán Zörgő 17-May-12 14:15pm    
First of all please answer: do you want to build a client-server application, or a standalone desktop application?
I need much more information to suggest you something concrete. It really depends on how you want to build and use your application. It would take a whole page of if-then-else sentences, if I would try to write down the decision tree.
Mmohmmad 18-May-12 0:23am    
Dear ZOltan:
I want to build stand alone desktop
Zoltán Zörgő 18-May-12 3:51am    
Ok, this means, that you don't need server, concurrency, but you give all your data out of your hands.
Some options:
A) SQL Server Compact (http://msdn.microsoft.com/en-us/data/ff687142.aspx):
- you have great support in .NET
- you can use file level encryption (not strictly linked to the DBMS itself: http://blogs.msdn.com/b/stevelasker/archive/2008/05/14/security-and-encryption-for-sql-server-compact.aspx)
- you can use own field level encryption
B)Firebird embedded server (http://www.firebirdsql.org/manual/fbmetasecur-embedded.html):
- you have .net support, but no support in Visual Studio Express
- you have the above encryption possibilities
- more standard RDBMS than MSSQL
C)SQLLite (http://www.sqlite.org/):
- by default "embedded", really lightweight
- you have .net support, but NO VS support as I know
- you have the above file level encryption
- you have encryption extension (http://www.hwaci.com/sw/sqlite/see.html, not free or http://sqlcipher.net/ Opensource)

There are some others like, http://www.mcobject.com/perst that can be considered, or some native xml engines, but it depends what kind of data you want to store in it.
But keep in mind that, you give everithing to the customer. Even the encryption code. So you have tho consider how to hide it properly - but if somebody is good enough, will be able to decrypt it.

Also interesting: http://www.codeproject.com/Articles/36895/Building-an-embedded-database-engine-in-C
If you store sensitive information, I'd use a good database product and use all the features of the database to properly protect the data.

Other reasons are:
- multiuser support
- backup/restore operations are basic functionality
- mechanisms are widely used so they are reliable and so on
 
Share this answer
 
If this is really something big and serious, really a bank of information, relational-database approach with ADO.NET is usually much more appropriate, but this decision is not exactly 100% certain. There are too many factors (which you did not share with us) which needs to be taken into account for considering alternatives (or not). Same goes about encryption. You need to learn about encryption technologies and devise your security schema thoroughly.

—SA
 
Share this answer
 
Comments
Mmohmmad 17-May-12 14:04pm    
Dear SAKryukov:

Thanks for your nice answer. My database is big and the first thing that is important to us is security. We also want to use data binding of Expression Blend 4 for our wpf program. furthermore, we want to optimize the size of file.

now what is your opinion?
Sergey Alexandrovich Kryukov 17-May-12 15:51pm    
You can implement security in all cases, but design of security schema depends on a number of factors, first of all, on you required workflow. Data binding through Expression Blend looks suspicious to me; this is rather a designer tool, may be good only for a prototype. You need to write your own code in ADO.NET.
--SA
For bank information you normally want to share the information. Putting information in a binary file is fine for local use, but not good for shared. Also, relational databases give you a lot of tools, which you will have to either live without or create on your own. There is really not much reason to not use a relational database in this case. The only thing I can come up with is that you have to keep the application very light. You have quite a few options for databases, and if you need growth, a database gives hou a lot of growth options. You can find out about the different editions of SQL Server here: http://en.wikipedia.org/wiki/Microsoft_SQL_Server[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900