SmartNote Database Design from user and note to note_tag
A practical walkthrough of SmartNote core tables, relationships, and why each design choice helps later backend work.
I started SmartNote from database design because schema choices define most backend boundaries early.
Core tables#
Current core tables:
usernotetagnote_tagfavorite
These are enough to support the first product loop.
user#
Stores registration and login identity.
Key points:
idas primary keyusername,password,emailfor auth flowcreate_time,update_timefor auditing
note#
Main business table.
Key points:
user_idbinds ownershiptitleandcontentstore core datais_deletedenables soft delete- timestamps support sorting and tracking
Relationship:
- one user to many notes
tag#
Stores tag definitions. The table is intentionally simple.
note_tag#
Bridge table for many-to-many between notes and tags.
Why this is required:
- one note can have many tags
- one tag can belong to many notes
This is also a common interview topic, so it is useful to implement and explain clearly.
favorite#
Represents user-note favorite relationships.
This is effectively another relation table with business meaning.
Design principles used in this version#
- Solve core product flow first
- registration/login
- note management
- tag classification
- search and favorites
- Keep expansion room
- view counts
- hot-note ranking
- search history
- richer user profile fields
- Keep migration-friendly boundaries
- easier transition from monolith to simple microservices
- user and note domains are already separable
Closing#
This schema is a foundation, not an endpoint. The next step is to map it into entities, services, and APIs, then iterate with real usage feedback.
Related posts
View allNote Table Design in MySQL for SmartNote
A focused design note on the note table structure, indexing strategy, and soft-delete decisions.
Why I Chose SmartNote as My Java Backend Practice Project
Why I moved away from generic template projects and started building a knowledge-focused backend project I can keep iterating.