-
-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[make:*] allow the option to use ULID's for entity id's #1488
Conversation
39e02dd
to
4c54a45
Compare
Are there any performance issues when using Ulid/Uuid, particularly in relationships between entities? |
Howdy @seb-jean - from my personal experience, no. That said, I've never profiled persistence calls using Usually in my own projects my entities are like: class SomeEntity
{
#[ORM\Column]
private Uuid $id;
public function __construct() {
$this->id = Uuid::v7(); // or whatever version I need
}
public function getId(): Uuid
{
...
}
} Often times I'll have the Anywho, that's just a bit of background on how I use uuid's instead of |
I saw a post from @tgalopin several years ago : https://medium.com/@galopintitouan/auto-increment-is-the-devil-using-uuids-in-symfony-and-doctrine-71763721b9a9 |
Ya, I'm not sure if the performance hits still hold true, I could be completely wrong however. The readability in I do recall, back in the day - databases did not support native I think the important thing to remember is, how much traffic is your app getting, what your infrastructure looks like, and do you really need to squeeze out an extra |
Thanks a lot for all these informations @jrushlow |
And regarding URLs, if I have a Could my base 58 URL #[Route('/post/{id}', name: 'app_post_show', methods: ['GET'])]
public function show(Request $request, Post $post): Response
{
} |
@nicolas-grekas you know that using U*IDs as primary keys is a bad practice.. Is this still the case for you? |
make:entity
make:reset-password
make:user