From: Gilberto N. <gil...@gm...> - 2014-10-08 12:37:31
|
Hello guys That is my first post, and I wonder if postgres-xc can handle with PK conflict... Let me explain... Let say if I have two store and the DB is deploy under postgres-xc. Now Store A, record a register like 00010, and Store B record a register like 00010 two. And both sites write this locally and in a center DB with postgres-xc too, of course... How postgres-xc will handle with this? Or I will need create differents ID for both Store like A00010, for Store A, and B00010, fo Store B. Thanks for all help -- -- Gilberto Ferreira |
From: Michael P. <mic...@gm...> - 2014-10-08 13:12:16
|
On Wed, Oct 8, 2014 at 9:36 PM, Gilberto Nunes <gil...@gm...> wrote: > Let say if I have two store and the DB is deploy under postgres-xc. Now > Store A, record a register like 00010, and Store B record a register like > 00010 two. > And both sites write this locally and in a center DB with postgres-xc too, > of course... > How postgres-xc will handle with this? Or I will need create differents ID > for both Store like A00010, for Store A, and B00010, fo Store B. > Note the definition of constraints is strictly related to the distribution of the table they are defined on. For example, in the case of hash tables, primary keys and unique constraints need absolutely to contain the column sharded. For replicated tables, there is no real restriction, at the cost that each write needs to be done with 2PC on all the nodes. Btw, what I meant in this explanation is something that you have perhaps already guessed: constraint definition restriction is here because XC guarantees only constraint checks on the datanodes, and not on coordinators. -- Michael |
From: Gilberto N. <gil...@gm...> - 2014-10-08 13:24:44
|
So, in other words, I will have this on the clients ( nodes ) and not on the central DB ( coordinators ). Sorry if I do not understand cleary what you explain... I am really new in DB world... 2014-10-08 10:12 GMT-03:00 Michael Paquier <mic...@gm...>: > > > On Wed, Oct 8, 2014 at 9:36 PM, Gilberto Nunes <gil...@gm... > > wrote: > >> Let say if I have two store and the DB is deploy under postgres-xc. Now >> Store A, record a register like 00010, and Store B record a register like >> 00010 two. >> And both sites write this locally and in a center DB with postgres-xc >> too, of course... >> How postgres-xc will handle with this? Or I will need create differents >> ID for both Store like A00010, for Store A, and B00010, fo Store B. >> > Note the definition of constraints is strictly related to the distribution > of the table they are defined on. For example, in the case of hash tables, > primary keys and unique constraints need absolutely to contain the column > sharded. For replicated tables, there is no real restriction, at the cost > that each write needs to be done with 2PC on all the nodes. Btw, what I > meant in this explanation is something that you have perhaps already > guessed: constraint definition restriction is here because XC guarantees > only constraint checks on the datanodes, and not on coordinators. > -- > Michael > -- -- Gilberto Ferreira |
From: Michael P. <mic...@gm...> - 2014-10-08 23:34:11
|
On Wed, Oct 8, 2014 at 10:23 PM, Gilberto Nunes <gil...@gm...> wrote: > So, in other words, I will have this on the clients ( nodes ) and not on > the central DB (coordinators). > Sorry if I do not understand cleary what you explain... I am really new in > DB world... > A Postgres-XC cluster is made of a series of Coordinator and Datanodes. But instead of explaining it by email, I highly recommend that you read some related documentation that can easily be found on the net and understand its infrastructure before even trying to use it. Here is for example one: https://wiki.postgresql.org/images/4/44/Postgres-XC_Write-Scalable_Cluster.pdf I don't really know what you are trying to solve, but before exploring XC you should consider as well more simple solutions like a single PostgreSQL server coupled with some read-only standbys if you are really new in working on such systems. Multi-master looks great on the paper, with costs in either hardware, data availability or performance. Regards, -- Michael |
From: Gilberto N. <gil...@gm...> - 2014-10-09 00:02:14
|
Nice... Thanks for help me 2014-10-08 20:34 GMT-03:00 Michael Paquier <mic...@gm...>: > > > On Wed, Oct 8, 2014 at 10:23 PM, Gilberto Nunes < > gil...@gm...> wrote: > >> So, in other words, I will have this on the clients ( nodes ) and not on >> the central DB (coordinators). >> Sorry if I do not understand cleary what you explain... I am really new >> in DB world... >> > A Postgres-XC cluster is made of a series of Coordinator and Datanodes. > But instead of explaining it by email, I highly recommend that you read > some related documentation that can easily be found on the net and > understand its infrastructure before even trying to use it. Here is for > example one: > > https://wiki.postgresql.org/images/4/44/Postgres-XC_Write-Scalable_Cluster.pdf > > I don't really know what you are trying to solve, but before exploring XC > you should consider as well more simple solutions like a single PostgreSQL > server coupled with some read-only standbys if you are really new in > working on such systems. Multi-master looks great on the paper, with costs > in either hardware, data availability or performance. > Regards, > -- > Michael > -- -- Gilberto Ferreira |