Should primary keys of MySQL tables be exposed?

后端 未结 6 1394
天涯浪人
天涯浪人 2021-01-02 10:38

I have a number of MySQL tables describing models such as \"User\", \"Business\" etc. Should the primary keys of these tables ever be exposed to the client-side? I am asking

6条回答
  •  暖寄归人
    2021-01-02 11:03

    Have a column of UUIDs along with the auto-increment primary keys in your table. Expose the UUID in the clients, and use the auto-increment keys for joins and backend processes.

提交回复
热议问题