Monday, January 8, 2018

Using a string as a primary key instead of an integer?

So I could just go ahead and do this, but I have no idea of the knock on effect it may have from a performance standpoint.

I currently use Firebase authentication and capture the uid it generates, storing it in my own database. However, the Id in my table is an incrementing integer, this means if I want to check if a user owns another record (for example) then I have to query the user table.

Would it be more efficient to replace the user id with the one generated by Firebase? They look like this... li2kA4FAJIWhXRYDuRiSgG3vqPX2

Using a string as a primary key instead of an integer? Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team