Jump to content

[C#] Database alternatives

MatazaNZ

People of LTT programming section,

I'm writing an application to further my learning, so it's nothing that will be released, but I want to find out something.

My application needs a couple of databases for users and inventory, but as it's just something I'm making in my spare time at home, I don't have the time or resources for a proper sql database server. Nor is it really necessary. I would like to know what I can use as alternatives, preferably as local files external to the application itself. I know I can use xml files, but from what I know, it's quite cumbersome to do anything with that unless you read the whole thing into memory and serialise it back when done.

Are there any other ways to do this that are efficient and not too messy with code? I'm prepared to do the xml route if that's the only feasible option, but I would like to know if there are other options.

And if you do give me any options, please give me a means of learning more about it :D thank you

Link to comment
Share on other sites

Link to post
Share on other sites

Give SQLite a try. It's a simple way to give your application a local database.

 

You can download it from the site or add it to a project through NuGet.

 

If even that is too much for some reason, using XML or CSV files should be good enough.

Link to comment
Share on other sites

Link to post
Share on other sites

Give SQLite a try. It's a simple way to give your application a local database.

You can download it from the site or add it to a project through NuGet.

If even that is too much for some reason, using XML or CSV files should be good enough.

Thank you, I'll give that a look when I get home
Link to comment
Share on other sites

Link to post
Share on other sites

Give SQLite a try. It's a simple way to give your application a local database.

You can download it from the site or add it to a project through NuGet.

If even that is too much for some reason, using XML or CSV files should be good enough.

Finally someone else who recommends SQLite!
Link to comment
Share on other sites

Link to post
Share on other sites

Finally someone else who recommends SQLite!

why wouldn't people recommend it?

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

why wouldn't people recommend it?

Most people don't know it exists. Someone wants to to a database and it's a bunch of use this or that server based one. SQLite is phenomenal for small projects or things where you need local database. Great for system configurations too.
Link to comment
Share on other sites

Link to post
Share on other sites

Most people don't know it exists. Someone wants to to a database and it's a bunch of use this or that server based one. SQLite is phenomenal for small projects or things where you need local database. Great for system configurations too.

Yea, that sums up my experience. Any database software that I've found either uses a server, or I can't find any way to use it with C#. I know I could use an Access database, as I've used that for Java in class, but I don't own Access, nor am I going to pirate it
Link to comment
Share on other sites

Link to post
Share on other sites

...probably more powerful than access

Sorry but Access is complete garbage.

SQLite would be a good choice, another could be a NoSQL option. You can even layer the Entity Framework or NHibernate over these to make life even easier for yourself.

In any event whatever you do choose should be implemented behind an interface. This way you will be able to test the behaviour (at the interface) and also swap the implementation without breaking everything else. You will have decoupled and encapsulated the implementation details. Take a look at the repository pattern.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

Sorry but Access is complete garbage.

SQLite would be a good choice, another could be a NoSQL option. You can even layer the Entity Framework or NHibernate over these to make life even easier for yourself.

In any event whatever you do choose should be implemented behind an interface. This way you will be able to test the behaviour (at the interface) and also swap the implementation without breaking everything else. You will have decoupled and encapsulated the implementation details. Take a look at the repository pattern.

Very important points here! Make your system database agnostic as much as possible.
Link to comment
Share on other sites

Link to post
Share on other sites

Sorry but Access is complete garbage.

SQLite would be a good choice, another could be a NoSQL option. You can even layer the Entity Framework or NHibernate over these to make life even easier for yourself.

In any event whatever you do choose should be implemented behind an interface. This way you will be able to test the behaviour (at the interface) and also swap the implementation without breaking everything else. You will have decoupled and encapsulated the implementation details. Take a look at the repository pattern.

I'll have to look into that, thanks
Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×