Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the reason behind uuid in laravel notifications

What is the reason uuid is the id in the notification system?

like image 924
Behrooz Valikhani Avatar asked Feb 25 '18 03:02

Behrooz Valikhani


1 Answers

The notifications table uses UUID's because they will scale much better for large applications and distributed databases. Since they aren't necessarily sequential, they are not subject to database column type limits either.

Here is a description straight from the ramsey/uuid library that laravel uses:

Anyone can create a UUID and use it to identify something with reasonable confidence that the same identifier will never be unintentionally created by anyone to identify something else. Information labeled with UUIDs can therefore be later combined into a single database without needing to resolve identifier (ID) conflicts.

like image 97
Austen Cameron Avatar answered Oct 08 '22 21:10

Austen Cameron