How to implement “autoincrement” on Google AppEngine

前端 未结 9 847
面向向阳花
面向向阳花 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

    If you absolutely have to have sequentially increasing numbers with no gaps, you'll need to use a single entity, which you update in a transaction to 'consume' each new number. You'll be limited, in practice, to about 1-5 numbers generated per second - which sounds like it'll be fine for your requirements.

提交回复
热议问题