Data model
The data model is a crucial component of the file-sharing service, as it defines the structure and relationships of the data entities involved. A well-designed data model ensures efficient storage, retrieval, and manipulation of data while supporting the functional requirements of the system. Let’s dive into the key entities and their relationships:
- The
User
entity represents the users of the file-sharing service, storing their basic information such as username, email, password hash, account creation, and last login timestamps. Each user is uniquely identified by theiruser_id
. - The
Document
entity represents the documents created and shared within the service. It contains the document title, content,owner_id
(referencing theUser
who created it), creation and update timestamps, and current version number. - The
Revision
entity stores the revision history of documents. Each revision is associated with a specific document and the user who made the changes...