Option number 1
In the first case, the database itself can better protect itself from some anomalies 1 . Some anomalies are still possible 2 but this is the beginning.
InnoDB tables, on the other hand, are clustered, and secondary indexes in cluster tables can be expensive (see “Disadvantages of Clustering” in this article ), which must be considered if you need to request a check_out
.
Option number 2
With the second option, you rely on imperative code even for anomalies that can be prohibited purely declaratively using database design.
On the plus side, you least need secondary indexes.
The choice
So, briefly move on to the first option, if you do not need a secondary index. If you need a secondary index, depending on what kind of coverage index you want to achieve, you can go with any of them.
1 Such as unloading without prior registration.
2 For example, when you turn on again, without first checking, overlapping "stints", etc.
source share