-
Notifications
You must be signed in to change notification settings - Fork 1.3k
How LiteDB Works
LiteDB is a single file database. To manage different information, LiteDB use database pages concepts. Each page has 4096 bytes. This is the minimum information read/write on file. LiteDB has 6 page types:
- Header Page: Contains database information, like file version, database version, pointer to free list pages.
- Collection Page
- Index Page
- Data Page
- Extended Page:
- Empty Page: This page exists and are empty (deleted page). Will be used next when
Each page has a own header and content. Header is used to manager page and contains common structure like PageID, PageType, Free Space.
To manager available page space, LiteDB use free list pages. This free list contains pages that can be used. When this spaces are less than a limit (different per page type) this page are remove from free list. This a simple way to reuse non full pages.
-
Collection Name
-
Documents per collections
-
Max Collections per Database
-
FileStorage Id
-
FileStorage Max File Length
-
Index Name
-
Index value size
-
BSON document size
-
Nested Depth for BSON Documents
-
Page Size
-
DataPage Reserved Bytes
-
IndexPage Reserved Bytes
-
Database Max Size
====
- database structures overview (pages, services)
- Document Growth
- file format
- database info
- transactions
- herança LiteDatabase
- user versions
- concurrence
- avoid dirty read
- concurrent read/write
- lock database / transaction
- windows locks - 250ms
- journaling
- recovery
- on open database
- journal file
- limit and sizes (page-size, index-per-collection, document-size)
- connection string
- thread safe?
Data Modeling
- Data Structure
- BsonDocument
- Object Mapping
- Relationships with Document References
- Collections
- FileStorage
Index
Query
Database
Version 4 changes
Shell