I am about to design my database for my synonym web application. If someone is typing a word for example ”important“ you should get some synonyms like ”essential“ or ”necessary“. Since a synonym web app has typically thousands of rows I want to design my database to get the information as fast as possible. For my application I found two possible designs for the synonym database.
| id | word | synonyms |
|---|---|---|
| 1 | important | necessary, essential |
| id | parent_id | synonyms |
|---|---|---|
| 1 | null | important |
| 2 | 1 | necessary |
| 3 | 1 | essential |
But I don't know whether they are suitable.