pennant
pennant copied to clipboard
Database driver could support high frequency requests
Database driver does not work at scale, we have thousand of SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "features_name_scope_unique"
because of the driver architecture when you have thousand requests per seconds.
As advised by @timacdonald in https://github.com/laravel/pennant/pull/77, we could use an upsert
instead of an insert
.
Perhaps aninsert
in a try catch (UniqueConstraintViolationException)
should do the job because it is not really important to update
the record several times in a single request...