X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C8E7EDB89C for ; Thu, 17 Nov 2005 12:41:06 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 65966-03 for ; Thu, 17 Nov 2005 16:41:05 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from matrix.gatewaynet.com (host2.dynacom.ondsl.gr [62.103.35.210]) by svr1.postgresql.org (Postfix) with ESMTP id BBC8BDB83D for ; Thu, 17 Nov 2005 12:41:02 -0400 (AST) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id jAHHaHKc008885; Thu, 17 Nov 2005 19:36:17 +0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id jAHHaHaq008881; Thu, 17 Nov 2005 19:36:17 +0200 Date: Thu, 17 Nov 2005 19:36:17 +0200 (EET) From: Achilleus Mantzios To: codeWarrior cc: pgsql-sql@postgresql.org Subject: Re: idea for a geographically distributed database: how best In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/128 X-Sequence-Number: 23379 O codeWarrior έγραψε στις Nov 17, 2005 : > Sounds like a mis-guided approach to me... > > You might want to consider using latitude and longitude or zip codes or > taking more of a traditional "GIS" approach rather than duplicating data > across redundant databases. > > Another issue is that you end up having to query every database to find > proximity... Suppose you have 500 "cells" ? You now have to invoke some sort > of RPC mechanism on 499 other RDBMS, manage 500 user names and passwords, > retrieve potentially 500 recordsets, merge the data, etc... > > Your problems will continue to get more and more complex... You are better > off with a single RDBMS and a single schema... Andy, i agree with what codeWarrior says. But if you are interested in replication, dbmirror is very elegant (altho not as trendy) simple, and highly customizable replication solution. I have heavily modified dbmirror to even support Asynchronous Conditional row grained Foreign key dependency Traversal oriented Lazy Replication!!! (which ofcourse nobody wants :) > > > > > "Andy Ballingall" wrote in message > news:ECOWS04Mp8nkfZyufzT00010fe4@smtp-out4.blueyonder.co.uk... > > Hello, > > > > I've got a database for a website which is a variant of the 'show stuff > > near > > to me' sort of thing. > > > > Rather than host this database on a single server, I have a scheme in mind > > to break the database up geographically so that each one can run > > comfortably > > on a small server, but I'm not sure about the best way of implementing it. > > > > Here's the scheme: > > > > -------------------------------- > > Imagine that the country is split into an array of square cells. > > Each cell contains a database that stores information about people who > > live > > in the area covered by the cell. > > > > There's one problem with this scheme. What happens if you live near the > > edge > > of a cell? > > > > My solution is that any inserted data which lies near to the edge of cell > > A > > is *also* inserted in the database of the relevant neighbouring cell - > > let's > > say cell B. > > > > Thus, if someone lives in cell B, but close to the border with cell A, > > they'll see the data that is geographically close to > > them, even if it lies in cell A. > > > > -------------------------------- > > > > Is this a common pattern? > > > > I could, of course, simply find every insert, update and delete in the > > application and alter the code to explicitly update all the relevant > > databases, but is there a more elegant way of simply saying: "Do this > > transaction on both Database A and Database B" monotonically? > > > > I've had a look at some replication solutions, but they all seem to > > involve > > replicating an entire database. The advantage of my scheme is that if I > > can > > distribute my application over large numbers of small servers, I'll end up > > with more bangs for the buck, and it'll be much easier to manage growth by > > managing the number of servers, and number of cells hosted on each server. > > > > Thanks for any suggestions! > > Andy Ballingall > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 3: Have you checked our extensive FAQ? > > > > http://www.postgresql.org/docs/faq > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > -- -Achilleus