You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/09/27 05:22:35 UTC

[GitHub] [apisix-dashboard] nic-chen opened a new issue #519: discuss: how should we automatically generate a primary key for new resource

nic-chen opened a new issue #519:
URL: https://github.com/apache/apisix-dashboard/issues/519


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ x ] Question or discussion
   - [ ] Bug
   - [ ] Requirements
   - [ ] Feature or performance improvement
   - [ ] Other
   
   ___
   ### Question
   - What do you want to know?
   
   When creating a new resource, we should automatically generate a primary key value instead of [letting the client provide one](https://github.com/apache/apisix-dashboard/blob/refactor/api/internal/core/store/store.go#L189).
   
   Here is the question:
   Should we generate a uuid as the primary key value, or should we use etcd revision as the primary key value like [APISIX admin api](https://github.com/apache/apisix/blob/master/apisix/core/etcd.lua#L253)? 
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on issue #519: discuss: how should we automatically generate a primary key for new resource

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #519:
URL: https://github.com/apache/apisix-dashboard/issues/519#issuecomment-699639150


   agree with Snowflake!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] membphis commented on issue #519: discuss: how should we automatically generate a primary key for new resource

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #519:
URL: https://github.com/apache/apisix-dashboard/issues/519#issuecomment-699637825


   > uuid is a little heavy(128bit), snowflake is fine(64bit), how do you think?
   
   I think we can make a try with `snowflake` .


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush commented on issue #519: discuss: how should we automatically generate a primary key for new resource

Posted by GitBox <gi...@apache.org>.
ShiningRush commented on issue #519:
URL: https://github.com/apache/apisix-dashboard/issues/519#issuecomment-699633934


   OK, I got it. I think it not a good way that using etcd revision as key.
   When two request arrive the server at same time, the later request will cover the former, because them maybe get the same revision.
   uuid is a little heavy(128bit), snowflake is fine(64bit), how do you think?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #519: discuss: how should we automatically generate a primary key for new resource

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #519:
URL: https://github.com/apache/apisix-dashboard/issues/519#issuecomment-699630464


   > I understand the scenario we are taking about is that user does not give primary key in `PUT` request, right?
   
   it should be `POST` which means `create`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] moonming commented on issue #519: discuss: how should we automatically generate a primary key for new resource

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #519:
URL: https://github.com/apache/apisix-dashboard/issues/519#issuecomment-699588071


   I prefer to etcd revision, which is more easy to trace and will not conflict in cluster.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #519: discuss: how should we automatically generate a primary key for new resource

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #519:
URL: https://github.com/apache/apisix-dashboard/issues/519#issuecomment-699587734


   @ShiningRush @membphis @moonming @gxthrj 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] moonming commented on issue #519: discuss: how should we automatically generate a primary key for new resource

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #519:
URL: https://github.com/apache/apisix-dashboard/issues/519#issuecomment-699641196


   > agree with Snowflake!
   
   lgtm


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen closed issue #519: discuss: how should we automatically generate a primary key for new resource

Posted by GitBox <gi...@apache.org>.
nic-chen closed issue #519:
URL: https://github.com/apache/apisix-dashboard/issues/519


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush commented on issue #519: discuss: how should we automatically generate a primary key for new resource

Posted by GitBox <gi...@apache.org>.
ShiningRush commented on issue #519:
URL: https://github.com/apache/apisix-dashboard/issues/519#issuecomment-699629797


   I understand the scenario we are taking about is that user does not give primary key in `PUT` request, right?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org