Litedb: [QUESTION] About LiteDB Design

Created on 13 Oct 2020  路  3Comments  路  Source: mbdavid/LiteDB

Thanks to the original author and all the contributors of this project.

My question is not regarding the usage of the database but rather about the design itself, It would be a good reference if there are any materials about the design and architecture of LiteDB, so we can relate the theoretical of designing a database and the implementation.

I know i can read the code and understand that from there, but If there is any guide about the architecture or the design that will make the process faster and will raise a fewer questions.

Again thank you for making this project available for us.

question

Most helpful comment

@muhamad The overall structure of LiteDB is relatively simple. There are three layers:

  • Engine: implements the actual persistence logic, which includes stuff like seeking in the file, iterating through indexes, binary serialization/deserialization etc.

  • Document: contains the classes that are used to represent and manipulate valid BSON data (BsonValue, BsonDocument and BsonExpression).

  • Client: presents a friendly interface to the user, providing features like object-to-BsonDocument mapping, Linq-to-BsonExpression mapping and easy-to-use LiteDatabase and LiteCollection objects.

All 3 comments

@muhamad if you graduated from Computer Science College You already know most of Database system basics, so you just need to read the source code

since DbLite consists of many parts, one of these parts is the engine, and other parts related to C# itself

So, I will assume you want to learn the concepts of database engines

So, you can start From

as you see all of them is related to SQLite, since this is a very small library, but you should start with it

after that you can study, the LiteDb from the source code since you should have knowledge about terms like ACID transactions,
But it is an intensive task in thinking, most of the limitations or features codes from language limitation itself, sometimes you must implement your complete semi-language engine.

Also, Remember LiteDb is No SQL but from my personal experience, I think we should start with SQL before going with schema-less systems, but it is just a self-preferences

But For NoSql, I think you can take a look at unqlite since it is only implemented the engine and some utils, it is in process, but the concepts still pretty the same

Anyway, I did not answer your question, I just put a general answer.

So I think you should wait for @mbdavid or @lbnascimento

@AlBannaTechno Actually that is what I was looking for, thank you.

@muhamad The overall structure of LiteDB is relatively simple. There are three layers:

  • Engine: implements the actual persistence logic, which includes stuff like seeking in the file, iterating through indexes, binary serialization/deserialization etc.

  • Document: contains the classes that are used to represent and manipulate valid BSON data (BsonValue, BsonDocument and BsonExpression).

  • Client: presents a friendly interface to the user, providing features like object-to-BsonDocument mapping, Linq-to-BsonExpression mapping and easy-to-use LiteDatabase and LiteCollection objects.

Was this page helpful?
0 / 5 - 0 ratings