How to implement “autoincrement” on Google AppEngine

前端 未结 9 833
面向向阳花
面向向阳花 2020-11-27 16:23

I have to label something in a \"strong monotone increasing\" fashion. Be it Invoice Numbers, shipping label numbers or the like.

  1. A number MUST NOT BE used twi
9条回答
  •  一向
    一向 (楼主)
    2020-11-27 17:13

    I'm thinking in using the following solution: use CloudSQL (MySQL) to insert the records and assign the sequential ID (maybe with a Task Queue), later (using a Cron Task) move the records from CloudSQL back to the Datastore.

    The entities also can have a UUID, so we can map the entities from the Datastore in CloudSQL, and also have the sequential ID (for legal reasons).

提交回复
热议问题