Re: how to adjust auto increment id offset?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Yan Chunlu <springrider(at)gmail(dot)com>
Cc: John R Pierce <pierce(at)hogranch(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: how to adjust auto increment id offset?
Date: 2011-11-16 04:39:35
Message-ID: CAOR=d=3UDWr=nn0F5ABJC74NUd8Bj7wJdJcAXf_VOMszXg6txg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 15, 2011 at 9:03 PM, Yan Chunlu <springrider(at)gmail(dot)com> wrote:
> thanks a lot for the tip!
> sorry for used the wrong word, it is just multi-master but not sharding,  I
> would like to setup two master server across two datacenter.  one's id
> increased by 1, and the other by 2.
> so I could have a queue sync the record in the background by myself.  kind
> of a dumb way but it seems they only choice for me,  the delay within
> several minutes is acceptable.

you might want to look at either using a larger skip, like 10 or 20,
so you can add more servers at a later date if you need to. The other
way is to start each sequence at some huge offset like 2Billion and be
sure to use a bigint not a regular int.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2011-11-16 05:58:45 Re: partitioning a dataset + employing hysteresis condition
Previous Message Yan Chunlu 2011-11-16 04:03:40 Re: how to adjust auto increment id offset?