How to write your own nosql database?
Due to their nature, databases are data control structures that process multiple tasks in a synchronized manner, distribute data into…

How to write your own nosql database?
Due to their nature, databases are data control structures that process multiple tasks in a synchronized manner, distribute data into reliable blocks and make them easily accessible. With this explanation, we can determine all the necessary needs in our simple database example and set up the necessary structures.
What builds are you talking about exactly?
In our example project, we will create a nosql database. I will tell you the basic requirements of this structure with the following steps. Also, let’s take the firebase firestore project as an example nosql database.
Steps
- Receive data via websocket or rest-api in accordance with Collection/Document data model
- If the collection specified in the incoming creation request does not exist, create it and then add the data received in the request.
- Create read/write/delete/update actions
- Automatically get the id of the document that belongs to the parent as the main relative in subcollection structures.
- Basically includes time-series index feature and create new index data on user’s request
In the light of the explanations above, we can determine our basic project structure and the technologies we will use.
In terms of being a simple project, we will write the project with typescript using either nodejs or bun.sh technologies. And we will do a performance comparison for the two technologies in the future.
Requirements Nodejs or bun.sh typescript radash
curl -fsSL https://bun.sh/install | bash
cd ~/Desktop;
mkdir basic_db;
cd basic_db;
bun init;
bun add radash;
mkdir -p Data/collections Data/system;
touch Data/system/users.json Data/system/permissions.json Data/system/roles.json
Directory structure for data blocks
/Data/collections/{collectionName} /Data/collections/{collectionName}/blocks (all data is naively added here) /Data/collections/{collectionName}/indexes (index files will be in this directory) /Data/collections/{collectionName}/fields.json /Data/collections/{collectionName}/indexing_rules.json /Data/system /Data/users.json (contains the user information that can access the database) /Data/permissions.json (read-only) /Data/roles.json (sets the roles that can be assigned to users)
Now that we have outlined the project, we can start building the project in the next article.
메타데이터
- post_id
- d5d40f54e795
- slug
- how-to-write-a-nosql-database-d5d40f54e795
- url
- https://medium.com/@meftunca/how-to-write-a-nosql-database-d5d40f54e795
- canonical_url
- https://medium.com/@meftunca/how-to-write-a-nosql-database-d5d40f54e795
- author_url
- https://medium.com/@meftunca
- status
- ok
- fetched_at
- 2026-07-26 09:46:03