For a couple of reason which need not be mentioned here, because they are rather complex, I need to program my own NoSQL document database in node.js. However, I am quite confused as to what is the best way to store this data.
I’ve searched around on google, but most information is on how to use a database, not how to program one. The following questions were a blank on google:
To me, the name “document database”, and the fact that the smallest unit of data is a “document”, implies that each one would be stored in an own file. Is this correct?
Also, how are collections grouped together? Is each collection a folder of documents? Or a manifestation file pointing to different documents in a collection?
How should relations between documents be implemented? Is it compliant to the term “NoSQL database” to even have a concept of relations?
Should a NoSQL database contain a way to create schemas for documents, or should NoSQL databases be free-form and schema-less?
I would greatly appreciate it if anyone can answer these questions!👍