Closed potsky closed 6 months ago
Thanks for opening this one, @potsky. As we discussed, we will likely look at doing this via upserts to help with this issue.
I've opened a PR to address this issue. Thanks for reporting it. I'll close this now and we can track the PR.
This has been tagged and merged. Let me know if you hit this again, but we should be in the clear now.
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 aninsert
.Perhaps an
insert
in atry catch (UniqueConstraintViolationException)
should do the job because it is not really important toupdate
the record several times in a single request...