mysql - Generating unique primary Ids of int32 & int64 sizes -


i developing social web application using java , distributed nosql db(cassandra). i need generate ids new users , posts on application in sizes of 32bits , 64 bits respectively.

because of building on top of distributed platform, our problem of generating ids/keys has become more complicated. although there have come solutions zookeeper/ or twitter's snowflake have helpfully been trying alleviate pain, these solutions not seem simple use.

after looking @ these solutions top level view, feel going simple solution , mature. using mysql database way flickr's ticket servers, comes mind first preference seems easiest solution.

http://code.flickr.com/blog/2010/02/08/ticket-servers-distributed-unique-primary-keys-on-the-cheap/

i know create spof around distributed system.. still believe easiest solution days(when have less resources in terms of capital , manpower). when application grows believe switching no difficult no heavy data transferred. infancy state of application guess mysql can serve me in best , simplest manner generate ids.

major factors choice:-

  1.   easier implementation   2.   easy switching anytime in future   3.   mature   4.   mysql may required our other needs well,  

i thinking of using single mysql server , later switch 2 servers flickr's solution inorder remove spof.

can point out issues may arise later when consider switching alternate solution zookeeper or snowflake? or may downsides of proposed current approach?

thanks lot time!

i know create spof around distributed system.. still believe easiest solution days

no, easiest solution use identifiers distributed dbms provides. way avoids

  • separate server hardware mysql
  • installing, configuring, , securing operating system
  • installing, configuring, , securing dbms

and need sequentiality lot less want it.

i know create spof around distributed system.

it create multiple single points of failure. odds each piece of server hardware, except possibly disks, single points of failure. (how many power supplies going put in there? how many disk controllers? how many nics?) there legion of software single points of failure, too.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -