Why locking in the first place? Because in many scenarios we need to guarantee the consistency of the data, this means that we will not allow for one user changing data that another user has already edited. There are 2 types of locks that we can implement: optimistic pessimistic When pessimistic? A pessimistic lock isRead more