Skip to content

Commit 5410c0e

Browse files
committed
#3d899pe - Document Database Indicies
1 parent e14b316 commit 5410c0e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ There is the Database Schema to fully visualize everything together:
4545

4646
![MySQL Database Design](/assets/imgs/docs/mysql_database_design.png "MySQL Database Design")
4747

48+
Regarding tables' indices (I will exclude mentioning the auto-generated indices such as primary and foreign keys):
49+
- **Applications Table**:
50+
- `token`: Unique constraint index. (Need the most in find queries)
51+
- **Chats Table** and **Messages Table**:
52+
- `number` and the foreign key: Composite unique constraint index.
53+
54+
No more indices is needed to keep the MySQL operations optimized as each data change operation will require every index to be updated before applying the next operation is applied, so I think they are very enough and every one is doing no more than his job.
55+
4856
### Code Documentation
4957
#### Generated Token of the Application
5058
I was debating about using **JSON Web Token (JWT)**, **UUID** or any randomly generated string, so I thought that using **randomly generate 32 hex chars length string** would be the best here as used below.

0 commit comments

Comments
 (0)