Erlang/OTP Forums

Author Message

<  Erlang questions mailing list  ~  PostgreSQL driver

Guest
Posted: Tue Nov 27, 2007 3:22 pm Reply with quote
Guest
Hello

Anybody have some experience with using any PostgreSQL driver for Erlang
in production environment ? As far as I know,there's one from
process-net and second from Jungerl project. Did anybody used any of
them or some other (ODBC ?) for any production Erlang application ?

Basically,I'd like to know it's stability in production enviroment.
There's no need for some special SQL commands or whatsoever,just plain
'select','update',insert' and stuff like that,all returning known kind
of OIDs to driver itself.

Sincerely

Dragan Zubac
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
noss
Posted: Tue Nov 27, 2007 4:36 pm Reply with quote
User Joined: 09 Oct 2005 Posts: 290
The postgres driver in jungerl has no test suite that one use to
verify how good it is. I think process one uses their postgres driver
as an optional db backend in jabberd so it should have some more
widespread production use, but im guessing.

The best you can do is to write a testsuite and contribute. It
increases the chance that future development does not break your usage
patterns.

2007/11/26, Dragan Zubac <zubac@vlayko.tv>:
> Hello
>
> Anybody have some experience with using any PostgreSQL driver for Erlang
> in production environment ? As far as I know,there's one from
> process-net and second from Jungerl project. Did anybody used any of
> them or some other (ODBC ?) for any production Erlang application ?
>
> Basically,I'd like to know it's stability in production enviroment.
> There's no need for some special SQL commands or whatsoever,just plain
> 'select','update',insert' and stuff like that,all returning known kind
> of OIDs to driver itself.
>
> Sincerely
>
> Dragan Zubac
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@erlang.org
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
View user's profile Send private message
Guest
Posted: Tue Nov 27, 2007 5:08 pm Reply with quote
Guest
Hello,

> Anybody have some experience with using any PostgreSQL driver for Erlang
> in production environment ?

We have been using Erlang + ODBC + PostgreSQL in production environment for
almost three years now.
Our application is quite database-intensive. To give you an idea, a gzipped
dump database file is 18MB right now, 180MB uncompressed, almost 3 million
rows.
We had some efficiency and performance issues at the beginning, and had to
un-normalize some of the tables. We do have complex relationships between
entities that force us to work with joins and subselects rather often,
though. Still, after taking care of that, the application has been working
perfectly ever since (at least with regard to the database Very Happy).

Regards,

--
Laura M. Castro
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
Guest
Posted: Fri Nov 30, 2007 10:25 am Reply with quote
Guest
Christian S ecrivait le 27.11.2007 17:23:
> The postgres driver in jungerl has no test suite that one use to
> verify how good it is. I think process one uses their postgres driver
> as an optional db backend in jabberd so it should have some more
> widespread production use, but im guessing.

the postgres driver from jungerl is used by tsung; no bug has been
reported, so the driver must be ok, i guess Smile

--
Nicolas
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
nindeu
Posted: Fri Nov 30, 2007 12:40 pm Reply with quote
User Joined: 25 Oct 2007 Posts: 13
Hi,

I am quite confused. And if I search the different mailing lists on trapexit for postgres I get the feeling that I am not alone.

I investigated just a little bit, so let me try to summarize what I found so far. Maybe we can bring some light into what realistic options exist for postgres?

Please correct me and maybe add your own experiences!

I think we have the following options:

Erlang OTP ODBC:
~~~~~~~~~~~~~~~~
Source: Included in Erlang.
Remarks:
+ Laura successfully uses it in production.
+ A patch exists for in/out parameters of stored procedures: http://forum.trapexit.org/mailinglists/viewtopic.php?t=10254&highlight=postgres
Might get incorporated into R12B-1


Christian's native driver in Jungerl:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Source: http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/pgsql/
Remarks:
+ Christian seems to updates it if you send him usefull patches.
+ Tsung uses it.

Process-one's native driver:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Source: I guess: https://forge.process-one.net/browse/ejabberd-modules/pgsql
Remarks:
+ ejabberd might use it. But I think it's not included in the default installation. And according to http://www.ejabberd.im/node/537 it is recommended to use Christian's Jungerl version. That would mean that probably most people use the Jungerl version. Can anyone comment/confirm?
+ I think this is a branch of Christian's driver, not including his latest patches but others.

erlang-consulting's native driver:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Source: http://www.erlang-consulting.com/aboutus/opensource.html
Remarks:
+ Seems to be used by http://erlyweb.org/. Possibly a modified version.

If you have first hand experiences, maybe you can elaborate a bit regarding stability, performance and features?

Regards,
Eric

--
Psssst! Schon vom neuen GMX MultiMessenger geh
View user's profile Send private message
noss
Posted: Fri Nov 30, 2007 1:02 pm Reply with quote
User Joined: 09 Oct 2005 Posts: 290
Yes it is all a mess. The following thread last year was full of good
ideas for what I really want generalized erlang sql access to be:

http://www.nabble.com/Simple-DB-Access-t2028308.html

I recall reading that OTP was looking into building a generalized
database layer which made me feel less "responsible" for clearing up
mess.
Kenneth Lundin: got a comment?

PS.
I pondered publishing pgsql as a GIT repo, but that would create yet
another version, adding to the confusion. Perhaps the benefits
outweigh that?

2007/11/30, nindeu@gmx.at <nindeu@gmx.at>:
> Hi,
>
> I am quite confused. And if I search the different mailing lists on trapexit for postgres I get the feeling that I am not alone.
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
View user's profile Send private message
Guest
Posted: Fri Nov 30, 2007 1:28 pm Reply with quote
Guest
On Nov 30, 2007, at 1:00 PM, Christian S wrote:

> I pondered publishing pgsql as a GIT repo, but that would create yet
> another version, adding to the confusion. Perhaps the benefits
> outweigh that?


Does everyone hate Google Code?

I think it's a step up from SourceForge (the forums are horrendous).

--
http://wagerlabs.com





_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
noss
Posted: Fri Nov 30, 2007 1:45 pm Reply with quote
User Joined: 09 Oct 2005 Posts: 290
> Does everyone hate Google Code?
>
> I think it's a step up from SourceForge (the forums are horrendous).

That question is begging for a long off-topic thread about the merits
of various kinds of version control systems. We have the blogosphere
for that. Smile
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
View user's profile Send private message
Guest
Posted: Fri Nov 30, 2007 2:05 pm Reply with quote
Guest
On 30 Nov 2007, at 13:00, Christian S wrote:

> PS.
> I pondered publishing pgsql as a GIT repo, but that would create yet
> another version, adding to the confusion. Perhaps the benefits
> outweigh that?

When the building is falling to pieces all around it's time to go
ponder on an alternative brand of nail. One that almost no-one has the
right kind of hammer to insert. Yep, seems like a plan Wink

Sean

_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
Guest
Posted: Fri Nov 30, 2007 2:22 pm Reply with quote
Guest
The version stored on ejabberd-modules contains all stability patches
and should be up-to-date.
It's bundled with default ejabberd package and running in production.

We are ready to maintain a centralized up-to-date svn repository for
both pgsql and mysql driver if we get patches.

_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
nindeu
Posted: Fri Nov 30, 2007 3:09 pm Reply with quote
User Joined: 25 Oct 2007 Posts: 13
On Nov 30, 2007 2:00 PM, Christian S <chsu79@gmail.com> wrote:
> Yes it is all a mess. The following thread last year was full of good
> ideas for what I really want generalized erlang sql access to be:
>
> http://www.nabble.com/Simple-DB-Access-t2028308.html

edbc would for sure be a greate thing. Just look what significant value jdbc forms. It's one of the core technologies of so many java projects.
Hmmm, I am pretty convinced it's not an easy task to create some kind of edbc.

> I recall reading that OTP was looking into building a generalized
> database layer which made me feel less "responsible" for clearing up
> mess.

*Shaking my head* As if you were responsible for the mess! Hey, people owe you a lot since you put a lot of time into creating a piece of software others apparently use a lot!


On Nov 30, 2007 3:19 PM, Christophe ROMAIN <christophe.romain@process-one.net> wrote:
> The version stored on ejabberd-modules contains all stability patches
> and should be up-to-date.
> It's bundled with default ejabberd package and running in production.

Sorry for indicating incorrect information regarding the use of pgsql in ejabberd! I was only looking at the source code version of ejabberd. My apologies!

Regarding up-to-dateness (is this an english expression?) of your version: What I meant with your driver not including all patches of Christian but incorporating a few others: Just look at the next version of Christian's driver after you branched:

http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/pgsql/src/pgsql_util.erl?r1=1.4&r2=1.5

But I have to admit, I currently do not know what the background of these changes is.

Regards,
Eric
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
View user's profile Send private message
uwiger
Posted: Fri Nov 30, 2007 3:40 pm Reply with quote
User Joined: 03 Jul 2006 Posts: 567 Location: Sweden
nindeu@gmx.at skrev:
> On Nov 30, 2007 2:00 PM, Christian S <chsu79@gmail.com> wrote:
>> Yes it is all a mess. The following thread last year was full of good
>> ideas for what I really want generalized erlang sql access to be:
>>
>> http://www.nabble.com/Simple-DB-Access-t2028308.html
>
> edbc would for sure be a greate thing. Just look what significant
> value jdbc forms. It's one of the core technologies of so many java
> projects.
> Hmmm, I am pretty convinced it's not an easy task to create some kind
> of edbc.

On the topic of coordinating external DB transactions with mnesia
transactions, I think some form of extension of the mnesia callback
API is needed.

I introduced some extra callback functions for rdbms, in the form
of patches to mnesia:

begin_activity(Type, Factor, Tid, Ts) -> void()
pre_commit(Result, Type, Tid, Ts) -> void()
end_activity(Result, Type, Tid, Ts) -> void()

I made them optional, to be compatible with old callbacks.

With some peeking into mnesia's activity state, it is
possible to determine in begin_activity/4 whether the
transaction has been restarted, or whether it's a nested
transaction.

Crashes in begin_activity/4 or end_activity/4 lead to
mnesia dumping core. A crash in pre_commit leads to a
transaction abort.

I haven't given much thought to what would be required
to synch with e.g. MySql or PostgreSQL, but perhaps these
could form a starting point for such a discussion.

BR,
Ulf W
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
View user's profile Send private message Visit poster's website
noss
Posted: Fri Nov 30, 2007 3:49 pm Reply with quote
User Joined: 09 Oct 2005 Posts: 290
http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/pgsql/src/pgsql_util.erl?r1=1.4&r2=1.5
>
> But I have to admit, I currently do not know what the background of these changes is.

I was playing with converting sql/postgres types into structured
types. A postgres result set includes column type information, so the
code can parse up, say, a timestamp to the {Date, Time} tuple we're
used to. Among other things.

Of course, as these things are added, they also break existing code
that unknowingly just upgrade to the latest version. This is how I
contribute to the mess.

PS.
Java is in a different situation with jdbc, because they dont have
mnesia which solves 90% of all erlang-projects' persistence problems.
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
View user's profile Send private message
noss
Posted: Fri Nov 30, 2007 3:51 pm Reply with quote
User Joined: 09 Oct 2005 Posts: 290
> I haven't given much thought to what would be required
> to synch with e.g. MySql or PostgreSQL, but perhaps these
> could form a starting point for such a discussion.

That is an interesting thought, PostgreSQL has support for two-phase
commit right now, so one could mirror mnesia transactions out to it.
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist
View user's profile Send private message
Guest
Posted: Fri Nov 30, 2007 3:55 pm Reply with quote
Guest
> Regarding up-to-dateness (is this an english expression?) of your
> version: What I meant with your driver not including all patches of
> Christian but incorporating a few others: Just look at the next
> version of Christian's driver after you branched:
> http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/pgsql/src/
> pgsql_util.erl?r1=1.4&r2=1.5

That's why i said "should" Smile
We patched the code to make it stable with ejabberd and integrated it
in our svn repository not to depend on sourceforge.net accessibility.
But we did not merged the last patch anyway.
One just need to define which "official" repository to use and merge
all patches.

we use and need pgsql, that's why we are candidate to host the svn
repository.
by now, it's part of ejabberd-modules
https://forge.process-one.net/browse/ejabberd-modules/pgsql

_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 2
Goto page 1, 2  Next
Post new topic

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum