You're probably familiar with multi-level comments sections such as on Reddit, or Hackernews — a user can reply to a post, and the system allows multiple levels of nested replies. I recently needed to implement it, and found a few ways of modelling the database, with different complexities and tradeoffs. In this article, I will cover a few of them.
“Raw SQL? Like dinosaurs?” My professor once said. Then I used ORM in the existing project. Results? Dropped database.
If you have a database system with soft deletes and unique indexes you might have faced some problems. Imagine that a user deleted some record and wants to add another one with the same unique value. He can’t do that since unique constraint would be violated...
Catchy title, isn’t it? 🙃
It’s going to be a short and brief note about one nonobvious (at least for me) full-text search related thing in MySQL.