0

I'm currently designing a Windows desktop application to manage a lot of tasks for my church, but currently I'm stopped at how to keep proper data for these tasks. I don't want to connect to a remote server to store data (i.e. MySQL, or MSQL) and I prefer not to use JSON, or XML unless fully necessary. There would be some 150-500 rows of data with maybe 40-50 columns of data for each row, and an unknown amount of data in each column. I know how to do this with MySQL, but I don't want to do that unless it truly becomes necessary. Basically, are there any other alternatives? Or is MySQL just going to be the best way?

EDIT: The app will handle very sensitive data such as addresses, SSN numbers, phone numbers, as well as death and birth certificates, plus some financial data.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
hightekjonathan
  • 581
  • 1
  • 9
  • 29

3 Answers3

2

You can do a number of things. You can simply serialize the c# classes representing your data structures to disk using the built in c# facilities:

http://www.dotnetperls.com/serialize-list

Basically you load the data from disk when the app starts and write the data back out periodically (perhaps after every change). The data will probably consist in one or more collections of c# objects. This is the simplest solution. You can choose between saving in a binary format or XML out of the box. If the data is sensitive then you can encrypt it.

If you need complex query behavior, and you like sql, you can use an embedded sql database (SQL-Server Express and SQLite are examples). There are also numerous nonsql embedded databases to choose from.

Some embedded databases, such as SQLite have flavors that support powerful built in encryption. See here: https://www.zetetic.net/sqlcipher/

There is no proper way, there are many choices and you have to pick the one that serves you best under the circumstances. I've often written applications that simply write collections of objects out to the file system.

Robert Moskal
  • 21,737
  • 8
  • 62
  • 86
1

You should prefer a local instance of SQL-Server Express, which is far better integrated into the .NET Framework and those .NET tools (Visual Studio, OR-Mapper ...), than MySQL.

According to XML, you could have a look at LINQ to XML, which lets you create SQL queries upon your XML-files. LINQ in general is a really nice thing in my opinion :) It's based on data-queries with lambda expressions.

Another possibility is to use a document-based database like mongoDB (based on JSON-like documents). They have got an own API for .NET applications and starting with it isn't very difficult, if you follow the guides at http://docs.mongodb.org/manual/ and especially http://docs.mongodb.org/getting-started/csharp/


According to MSDN the hardware- requirements for SQL Server 2014 are the following:

RAM

Minimum:

Express Editions: 512 MB

All other editions: 1 GB

Recommended:

Express Editions: 1 GB

All other editions: At least 4 GB and should be increased as database size increases to ensure optimal performance.

PROCESSOR

Minimum:

x86 Processor: 1.0 GHz

x64 Processor: 1.4 GHz

Recommended: 2.0 GHz or faster

x64 Processor: AMD Opteron, AMD Athlon 64, Intel Xeon with Intel EM64T support, Intel Pentium IV with EM64T support

x86 Processor: Pentium III-compatible processor or faster

https://msdn.microsoft.com/en-us//library/ms143506.aspx

rfinster
  • 68
  • 9
  • What type of PC resources would that require? Im currently limited to a Core 2 duo, with 3GB of ram, on the production PC, but i7, and 12GB ram on my dev machine. – hightekjonathan May 10 '15 at 20:24
  • Looking into MongoDB, i think that might be what Im looking for. Am I able to connect to it remotely if need be? – hightekjonathan May 10 '15 at 20:50
  • I'm not sure what you mean .. you can run local instances as well as instances that can be addressed via network. – rfinster May 10 '15 at 21:26
0

I would recommend using SQLite.

SQLite does not require a standalone database server as it is built into your application.

"SQLite—a self-contained, zero-configuration, relational, transactional database engine." - MSDN

Here is a great tutorial showing you how to implement a SQLite setup,

Using SQLite in your C# Application

To ensure you data is secure this should get you started.

SQLite with encryption/password protection

Community
  • 1
  • 1
Dan Cundy
  • 2,649
  • 2
  • 38
  • 65