Difference between #18 and #19 of
UUID instead of an auto-increment integer for ID with Active Record

Revision #19 has been created by samdark on Apr 22, 2020, 1:09:03 PM with the memo:

Edited formatting
« previous (#18)

Changes

Title unchanged

UUID instead of an auto-increment integer for ID with Active Record

Category unchanged

How-tos

Yii version unchanged

2.0

Tags unchanged

mysql,active record,REST,UUID

Content changed

> I have a dream ... > I am happy to join with you today in what will go down in history as the greatest demonstration of
 
 
 bad design of Active Record.

I have an API. It's built with a RESTful extension over Active Record, and some endpoints provide PUT methods to upload files. By a REST design we create an entity with `POST /video` first, and then upload a video file with `PUT /video/{id}/data`.

How do we get the `{id}`? The essential solutuion is UUID generated by a client. It allows API application to be stateless and scale it, use master-master replication for databases and feel yourself a modern guy.
If you have Postgres — lucky you, feel free to use the built-in UUID data type and close this article.
[...]
5 0
4 followers
Viewed: 55 910 times
Version: 2.0
Category: How-tos
Written by: grigori
Last updated by: samdark
Created on: Nov 25, 2019
Last updated: 3 years ago
Update Article

Revisions

View all history