Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 03:52 AM
alfranio correia junior
 
Posts: n/a
Default standard interfaces for replication providers

Hi,

We have just released an add-on to PostgreSQL supporting the GORDA
Architecture and Programming Interface (GAPI). This opens up support for
DBMS
independent replication middleware, aimed at eager and multi-master
replication in clusters and WANs.

The implementation of the GAPI is achieved in two steps. First, a set of
patches to the PostgreSQL server and a plugin provide the necessary
functionality with minimal intrusion. Then the GAPI is exposed in a
standalone Java process.

Note that this is not yet a complete replication solution. Instead, we seek
feedback on exposed features, their rendering as Java interfaces, and their
implementation on PostgreSQL.

Downloads of source code and documentation are available at:

http://gorda.di.uminho.pt/community

There you will soon find the same interface implemented on Apache Derby and
a replication suite based on group-communication.

We welcome the comments and suggestions of PostgreSQL hackers.


Best regards,

Alfranio Junior.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 03:52 AM
Jonah H. Harris
 
Posts: n/a
Default Re: standard interfaces for replication providers

On 8/4/06, alfranio correia junior <alfranio@lsd.di.uminho.pt> wrote:
> patches to the PostgreSQL server and a plugin provide the necessary
> functionality with minimal intrusion.


I haven't looked at the patch for this in awhile, but does anyone have
anything against it? I personally like the triggers and think it
would be a nice thing to add.

--
Jonah H. Harris, Software Architect | phone: 732.331.1300
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 2nd Floor | jharris@enterprisedb.com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-12-2008, 03:52 AM
Tom Lane
 
Posts: n/a
Default Re: standard interfaces for replication providers

"Jonah H. Harris" <jonah.harris@gmail.com> writes:
> On 8/4/06, alfranio correia junior <alfranio@lsd.di.uminho.pt> wrote:
>> patches to the PostgreSQL server and a plugin provide the necessary
>> functionality with minimal intrusion.


> I haven't looked at the patch for this in awhile, but does anyone have
> anything against it?


We haven't been able to build production-grade multi-master replication
without the barrier of a "standard" database-agnostic API, so I kinda
doubt that it will work all that much better with one. See Slony-II.
In short the burden of proof is to show why this should go in, not why not.
(Suitable proof would be a usable replication system built atop it...)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-12-2008, 03:52 AM
=?utf-8?q?Jos=C3=A9_Orlando_Pereira?=
 
Posts: n/a
Default Re: standard interfaces for replication providers

On Friday 04 August 2006 16:46, Tom Lane wrote:
> We haven't been able to build production-grade multi-master replication
> without the barrier of a "standard" database-agnostic API, so I kinda
> doubt that it will work all that much better with one. See Slony-II.


I would argue that people haven't been able to build production-grade
multi-master replication, in part, due to the barrier of not having
a "standard" database-agnostic API. :-)

In fact, the problem is not the lack of a "standard" API but the lack of an
API at all. Having to learn the intrincacies of a database server (or build a
full fledged server wrapper) to experiment with simple prototypes is a
serious hurdle for R&D in database replication. This has been the case for
replication based on group communication.

> In short the burden of proof is to show why this should go in, not why not.


Please don't confuse two proposals included in the distributed package:

(1) A PostgreSQL specific patch, which implements a minimal set of required
features with a PostgreSQL-specific interface (e.g. triggers, new statements,
configuration variables). This is by no means a "standard" interface. The
included technical report discusses why these are required for a variety of
replication scenarios.

(2) A DBMS independent "standard" Java interface, which is easily built on
the modified PostgreSQL server using both existing features (e.g. normal
triggers) and those introduced by (1). Included toy applications show how
this would be useful for replication, but we are not (yet) pushing for its
adoption.

> (Suitable proof would be a usable replication system built atop it...)


I agree.

--
Jose Orlando Pereira

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-12-2008, 03:55 AM
Markus Schiltknecht
 
Posts: n/a
Default Re: standard interfaces for replication providers

Hi,

José Orlando Pereira wrote:
> I would argue that people haven't been able to build production-grade
> multi-master replication, in part, due to the barrier of not having
> a "standard" database-agnostic API. :-)
>
> In fact, the problem is not the lack of a "standard" API but the lack of an
> API at all. Having to learn the intrincacies of a database server (or build a
> full fledged server wrapper) to experiment with simple prototypes is a
> serious hurdle for R&D in database replication. This has been the case for
> replication based on group communication.


I disagree. There have been a couple of approaches and each has had a
different interface to the database. But for most of them, coding the
database interface was _not_ the hardest part. And a good understanding
of the database system internals is simply required to write a good
replication system.

> Please don't confuse two proposals included in the distributed package:
>
> (1) A PostgreSQL specific patch, which implements a minimal set of required
> features with a PostgreSQL-specific interface (e.g. triggers, new statements,
> configuration variables). This is by no means a "standard" interface. The
> included technical report discusses why these are required for a variety of
> replication scenarios.


Where do I find the included technical report?

I've read the READMEs in PostgreSQL/G toplevel and csrc directory and
did not find convincing reasons why exactly these triggers need to be
added as replication hooks. In fact, Postgres-R (8) would already need
different hooks.

From studying the patch, I understand that these hooks are quite close
to what's needed for a Postgres-R or Slony-II like sync, multi-master
replication system (i.e. hooks for writeset extraction, the addition of
a 'serialization error' for remote transactions).

I can see use for such an API as soon as we have a production-grade
replication system, which performs well enough in most applications
(i.e. when we know exactly where to place the hooks). But up until then,
people will try different algorithms and different hooks.

Concerning my work on Postgres-R I can tell: I'm not going to use these
triggers (hooks) because they are limiting. I know enough about the
database system internals and I _want_ to fiddle with the database
system. Why should I use such an API?

Regards

Markus
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-12-2008, 03:56 AM
Jose Orlando Pereira
 
Posts: n/a
Default Re: standard interfaces for replication providers

On Monday 07 August 2006 10:58, Markus Schiltknecht wrote:
>
> Where do I find the included technical report?


Sorry, stuff was put twice in the zip file making it somewhat confusing. It is
in postgresql-g-0.1/javasrc/GordaInterfaces/docs/gapi.pdf or directly on the
web site at http://gorda.di.uminho.pt/download/reports/gapi.pdf.

> From studying the patch, I understand that these hooks are quite close
> to what's needed for a Postgres-R or Slony-II like sync, multi-master
> replication system (i.e. hooks for writeset extraction, the addition of
> a 'serialization error' for remote transactions).


Good. Supporting Postgres-R-style protocols was one major goal of our work.

> In fact, Postgres-R (8) would already need different hooks.


> Concerning my work on Postgres-R I can tell: I'm not going to use these
> triggers (hooks) because they are limiting.


Can you point out why is it so, given that it is admittedly quite close?

We'd rather discuss specific issues instead of the general topic of whether to
build APIs around them. We certainly are not married to the proposed
interfaces, although the functionality they capture does reflect our
experience with several algorithms.

--
Jose Orlando Pereira

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-12-2008, 03:57 AM
alfranio correia junior
 
Posts: n/a
Default Re: standard interfaces for replication providers

Markus Schiltknecht wrote:
> Hi,
>
> José Orlando Pereira wrote:
>> I would argue that people haven't been able to build production-grade
>> multi-master replication, in part, due to the barrier of not having a
>> "standard" database-agnostic API. :-)
>>
>> In fact, the problem is not the lack of a "standard" API but the lack
>> of an API at all. Having to learn the intrincacies of a database
>> server (or build a full fledged server wrapper) to experiment with
>> simple prototypes is a serious hurdle for R&D in database
>> replication. This has been the case for replication based on group
>> communication.

>
> I disagree. There have been a couple of approaches and each has had a
> different interface to the database. But for most of them, coding the
> database interface was _not_ the hardest part. And a good
> understanding of the database system internals is simply required to
> write a good replication system.

I agree with you.
But, I would add that the same understanding is required to design and
implement this interface on any database system.
>
>> Please don't confuse two proposals included in the distributed package:
>>
>> (1) A PostgreSQL specific patch, which implements a minimal set of
>> required features with a PostgreSQL-specific interface (e.g.
>> triggers, new statements, configuration variables). This is by no
>> means a "standard" interface. The included technical report discusses
>> why these are required for a variety of replication scenarios.

>
> Where do I find the included technical report?

GordaInterfaces/javasrc/docs/gapi.pdf
>
> I've read the READMEs in PostgreSQL/G toplevel and csrc directory and
> did not find convincing reasons why exactly these triggers need to be
> added as replication hooks. In fact, Postgres-R (8) would already need
> different hooks.

Such triggers are not necessary to develop any kind of replication
protocol... However, indeed any replication protocol requires a set of
hooks that might be enabled by different means, e.g. call back
functions, triggers, etc, etc...
We developed our hooks by means of triggers as their provide a standard
interface (triggers) that might be easily exploited by other projects
besides replication, e.g. materialized views.

>
> From studying the patch, I understand that these hooks are quite close
> to what's needed for a Postgres-R or Slony-II like sync, multi-master
> replication system (i.e. hooks for writeset extraction, the addition
> of a 'serialization error' for remote transactions).
>
> I can see use for such an API as soon as we have a production-grade
> replication system, which performs well enough in most applications
> (i.e. when we know exactly where to place the hooks). But up until
> then, people will try different algorithms and different hooks.
>
> Concerning my work on Postgres-R I can tell: I'm not going to use
> these triggers (hooks) because they are limiting.

Could you tell me why they are limiting ?
> I know enough about the database system internals and I _want_ to
> fiddle with the database system. Why should I use such an API?

The idea is not to impose our API but what we really want is to show
that behind the requirements for replication systems there is place for
a variety of systems that could be leverage by means of a "standard api".

Jose Orlando, any comments on that ?


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-12-2008, 03:57 AM
Markus Schiltknecht
 
Posts: n/a
Default Re: standard interfaces for replication providers

Hi,

Jose Orlando Pereira wrote:
> Sorry, stuff was put twice in the zip file making it somewhat confusing. It is
> in postgresql-g-0.1/javasrc/GordaInterfaces/docs/gapi.pdf or directly on the
> web site at http://gorda.di.uminho.pt/download/reports/gapi.pdf.


Thank you. I've just had a quick glance at it.

> Can you point out why is it [limiting], given that it is admittedly quite close?


An API is always limiting. And if you have to change the API a lot, to
fit your needs, what's the point in using it at all? Good APIs don't
change a lot.

Even if it's quite close, I estimate the effort to port Postgres-R to
use your API to be quite large. I.e. the first missing thing that came
to my mind was the ordering of processes when waking them up after
waiting for a lock. Postgres-R needs the processes to be woken up in the
order of writeset arrival.

Now, I didn't see anything related in the patch, but the gapi.pdf has
'Predictable Deadlock Handling' in it. I need to take another look...

> We'd rather discuss specific issues instead of the general topic of whether to
> build APIs around them. We certainly are not married to the proposed
> interfaces, although the functionality they capture does reflect our
> experience with several algorithms.


I still feel that I would need ways too many hooks. Especially when you
consider advanced replication features such as data partitioning and
remote query execution.

What also worries me is the use of triggers. ISTM that using triggers is
not deep enough in the database. In the above example, do I really want
to fire a trigger every time the database needs to wake up a process? In
PostgreSQL a trigger normally runs within a transaction. How do you work
around that?

I'm operating a level deeper with Postgres-R and really enjoy the
freedom I have with C. Having to write a hook or trigger for every
change in the database systems seems a lot of work, which I tend to
postpone until such a thing is really needed.

Regards

Markus


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-12-2008, 03:57 AM
Christopher Browne
 
Posts: n/a
Default Re: standard interfaces for replication providers

In the last exciting episode, markus@bluegap.ch (Markus Schiltknecht) wrote:
> I'm operating a level deeper with Postgres-R and really enjoy the
> freedom I have with C. Having to write a hook or trigger for every
> change in the database systems seems a lot of work, which I tend to
> postpone until such a thing is really needed.


The fact that GORDA is operating as a Java application seems to me to
throw a big layer of fuzziness in the way, too.

Most databases that are interesting to replicate are implemented in C
or C++, thereby implying that a suitably "deep" API needs to be
implemented in C.

In the case of PostgresQL, at least, operating in Java means that you
need to operate at "arms length" from the database, which means the
replication system is by no means tightly integrated.
--
(reverse (concatenate 'string "moc.liamg" "@" "enworbbc"))
http://linuxdatabases.info/info/postgresql.html
Know the list of "large, chronic problems". If there is any problem
with the window system, blame it on the activity system. Any lack of
user functionality should be attributed to the lack of a command
processor. A suprisingly large number of people will believe that you
have thought in depth about the issue to which you are alluding when you
do.
-- from the Symbolics Guidelines for Sending Mail
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-12-2008, 03:57 AM
Markus Schiltknecht
 
Posts: n/a
Default Re: standard interfaces for replication providers

Hello Christopher,

Christopher Browne wrote:
> Most databases that are interesting to replicate are implemented in C
> or C++, thereby implying that a suitably "deep" API needs to be
> implemented in C.


I generally agree with you. Although it's probably worth mentioning that
the API they propose adds hooks to PostgreSQL in the form of triggers.
This API comes as a patch is against the PostgreSQL source, thus in C.

The nature of triggers in PostgreSQL would then allow to write
replication systems in whatever language you prefer, as long as there is
a PL/{$LANG} for $LANG = your favorite.

I'm questioning if a replication system can be written by only using
triggers as hooks. AFAIK Slony-I uses triggers, so you can probably
better comment on problems or limitations using triggers. For me a
shared library with some hooks as C function calls seems a more
plausible approach.

Regards

Markus
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:58 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504