In this post, you will find an alternative VB.NET version of a .NET NoSQL Document Store in a single data file called LiteDB.
I thought this was an interesting article that might be relevent to VB.NET programmers for study and perhaps implementation.
A NoSQL (originally referring to "non SQL" or "non relational") database provides a mechanism for storage and retrieval of data that is modeled by means other than the tabular relations used in relational databases. NoSQL databases are increasingly used in big data and real-time web applications.
Nothing could be more representative of the sudden shift to NoSQL than established companies such as Facebook, Google and Amazon.com against well-established relational database technologies. It almost seems like one day the web was was being driven by a few RDBMSs, and the next, five or so NoSQL solutions have established themselves as worthy solutions.
Having said all of that, the first thing we ought to do is explain what is meant by NoSQL. Where relational database vendors have historically tried to position their software as a one-size-fits-all solution, NoSQL leans towards smaller units of responsibility where the best tool for a given job is often times fluid. NoSQL is about being open and aware of alternative, existing and additional patterns and tools for managing your data.
For a more extensive look at NoSQL databases, please visit this link.
LiteDB is a simple, fast and free embedded .NET NoSQL Document Store in a single data file. Inspired on MongoDB, supports collections, POCO classes, Bson Documents, indexes, stream data, ACID transactions, and LINQ expressions.
For detailed history and background, check out the original article at this link.
Understanding the Concepts
To get started, there are five simple concepts you need to understand.
- LiteDB has the same concept of a database which you are likely already familiar. Within a LiteDB instance, you can have zero or more databases (versions), each acting as high-level containers for everything else.
- A database can have zero or more collections. A collection shares enough in common with a traditional table that you can safely think of the two as the same thing.
- Collections are made up of zero or more documents. Again, a document can safely be thought of as a row.
- A document is made up of one or more fields, which you can probably guess are a lot like columns or Class Properties.
- Indexes in LiteDB function mostly like their RDBMS counterparts.
Points of Interest
The most difficult part of converting this project to VB.NET was the method below. VB uses a lot of conversion operators. I also had to turn off the option for Integer Overflow checking in the Project Properties to get this work:
- 15th October, 2015: Initial version