Re: Hadoop backend?

Поиск
Список
Период
Сортировка
Искать

Re: Hadoop backend?

От:
Hans-Jürgen Schönig <postgres@cybertec.at>
Дата:
hi ...

i think the easiest way to do this is to simply add a mechanism to functions which allows a function to "stream" data through.
it would basically mean losing join support as you cannot "read data again" in a way which is good enough good enough for joining with the function providing the data from hadoop.

hannu ( I think) brought up some concept as well some time ago.

i think a straight forward implementation would not be too hard.

best regards,

hans



On Feb 22, 2009, at 3:37 AM, pi song wrote:

1) Hadoop file system is very optimized for mostly read operation
2) As of a few months ago, hdfs doesn't support file appending.

There might be a bit of impedance to make them go together.

However, I think it should a very good initiative to come up with ideas to be able to run postgres on distributed file system (doesn't have to be specific hadoop).

Pi Song

On Sun, Feb 22, 2009 at 7:17 AM, Paul Sheer <paulsheer@gmail.com> wrote:
Hadoop backend for PostGreSQL....

A problem that my client has, and one that I come across often,
is that a database seems to always be associated with a particular
physical machine, a physical machine that has to be upgraded,
replaced, or otherwise maintained.

Even if the database is replicated, it just means there are two or
more machines. Replication is also a difficult thing to properly
manage.

With a distributed data store, the data would become a logical
object - no adding or removal of machines would affect the data.
This is an ideal that would remove a tremendous maintenance
burden from many sites ---- well, at least the one's I have worked
at as far as I can see.

Does anyone know of plans to implement PostGreSQL over Hadoop?

Yahoo seems to be doing this:
     http://glinden.blogspot.com/2008/05/yahoo-builds-two-petabyte-postgresql.html

But they store tables column-ways for their performance situation.
If one is doing a lot of inserts I don't think this is most efficient - ?

Has Yahoo put the source code for their work online?

Many thanks for any pointers.

-paul

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



--
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt

Re: Hadoop backend?

От:
pi song <pi.songs@gmail.com>
Дата:
1) Hadoop file system is very optimized for mostly read operation
2) As of a few months ago, hdfs doesn't support file appending.

There might be a bit of impedance to make them go together.

However, I think it should a very good initiative to come up with ideas to be able to run postgres on distributed file system (doesn't have to be specific hadoop).

Pi Song

On Sun, Feb 22, 2009 at 7:17 AM, Paul Sheer <paulsheer@gmail.com> wrote:
Hadoop backend for PostGreSQL....

A problem that my client has, and one that I come across often,
is that a database seems to always be associated with a particular
physical machine, a physical machine that has to be upgraded,
replaced, or otherwise maintained.

Even if the database is replicated, it just means there are two or
more machines. Replication is also a difficult thing to properly
manage.

With a distributed data store, the data would become a logical
object - no adding or removal of machines would affect the data.
This is an ideal that would remove a tremendous maintenance
burden from many sites ---- well, at least the one's I have worked
at as far as I can see.

Does anyone know of plans to implement PostGreSQL over Hadoop?

Yahoo seems to be doing this:
     http://glinden.blogspot.com/2008/05/yahoo-builds-two-petabyte-postgresql.html

But they store tables column-ways for their performance situation.
If one is doing a lot of inserts I don't think this is most efficient - ?

Has Yahoo put the source code for their work online?

Many thanks for any pointers.

-paul

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: Hadoop backend?

От:
pi song <pi.songs@gmail.com>
Дата:
One more problem is that data placement on HDFS is inherent, meaning you have no explicit control. Thus, you cannot place two sets of data which are likely to be joined together on the same node = uncontrollable latency during query processing.

Pi Song

On Mon, Feb 23, 2009 at 7:47 AM, Robert Haas <robertmhaas@gmail.com> wrote:
On Sat, Feb 21, 2009 at 9:37 PM, pi song <pi.songs@gmail.com> wrote:
> 1) Hadoop file system is very optimized for mostly read operation
> 2) As of a few months ago, hdfs doesn't support file appending.
> There might be a bit of impedance to make them go together.
> However, I think it should a very good initiative to come up with ideas to
> be able to run postgres on distributed file system (doesn't have to be
> specific hadoop).

In theory, I think you could make postgres work on any type of
underlying storage you like by writing a second smgr implementation
that would exist alongside md.c.  The fly in the ointment is that
you'd need a more sophisticated implementation of this line of code,
from smgropen:

   reln->smgr_which = 0;   /* we only have md.c at present */

Logically, it seems like the choice of smgr should track with the
notion of a tablespace.  IOW, you might to have one tablespace that is
stored on a magnetic disk (md.c) and another that is stored on your
hypothetical distributed filesystem (hypodfs.c).  I'm not sure how
hard this would be to implement, but I don't think smgropen() is in a
position to do syscache lookups, so probably not that easy.

...Robert

Re: Hadoop backend?

От:
pi song <pi.songs@gmail.com>
Дата:


On Mon, Feb 23, 2009 at 3:56 PM, pi song <pi.songs@gmail.com> wrote:
I think the point that you can access more system cache is right but that doesn't mean it will be more efficient than accessing from your local disk. Take Hadoop for example, your request for file content will have to go to Namenode (file chunk indexing service) and then you go ask the data node which then provides you data. Assuming that you're working on a large dataset, the probability of the data chunk you need staying in system cache is very low therefore most of the time you end up reading from a remote disk.

I've got a better idea. How about we make the buffer pool multilevel? The first level is the current one. The second level represents memory  from remote machines. Things that are used less often should stay on the second level. Has anyone ever thought about something like this before?

Pi Song

On Mon, Feb 23, 2009 at 1:09 PM, Robert Haas <robertmhaas@gmail.com> wrote:
On Sun, Feb 22, 2009 at 5:18 PM, pi song <pi.songs@gmail.com> wrote:
> One more problem is that data placement on HDFS is inherent, meaning you
> have no explicit control. Thus, you cannot place two sets of data which are
> likely to be joined together on the same node = uncontrollable latency
> during query processing.
> Pi Song

It would only be possible to have the actual PostgreSQL backends
running on a single node anyway, because they use shared memory to
hold lock tables and things.  The advantage of a distributed file
system would be that you could access more storage (and more system
buffer cache) than would be possible on a single system (or perhaps
the same amount but at less cost).  Assuming some sort of
per-tablespace control over the storage manager, you could put your
most frequently accessed data locally and the less frequently accessed
data into the DFS.

But you'd still have to pull all the data back to the master node to
do anything with it.  Being able to actually distribute the
computation would be a much harder problem.  Currently, we don't even
have the ability to bring multiple CPUs to bear on (for example) a
large sequential scan (even though all the data is on a single node).

...Robert


Re: Hadoop backend?

От:
pi song <pi.songs@gmail.com>
Дата:
|     I believe there is more than that which would need to be done nowadays.  I seem to recall that the storage manager| 
|     abstraction has slowly been dedicated/optimized for md over the past 6 years or so.  It may even be easier/preferred 
|     to write a hadoop specific access method depending on what you're looking for from hadoop.

I think you're very right. What Postgres needs is access method abstraction. One should be able to plug in access method for SSD or network file systems if appropriate. I don't talk about MapReduce bit in Hadoop because I think that's a different story. What you need for MapReduce are 1) data store which feeds you data and then 2) MapReduce does the query processing. This has nothing to share with Postgres query processor in common. If you just want data from Postgres then it should be easier to build postgres data feeder in Hadoop (which might even already exist).

Pi Song

On Tue, Feb 24, 2009 at 11:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"Jonah H. Harris" <jonah.harris@gmail.com> writes:
> I believe there is more than that which would need to be done nowadays.  I
> seem to recall that the storage manager abstraction has slowly been
> dedicated/optimized for md over the past 6 years or so.

As far as I can tell, the PG storage manager API is at the wrong level
of abstraction for pretty much everything.  These days, everything we do
is atop the Unix filesystem API, and anything that smgr might have been
able to do for us is getting handled in kernel filesystem code or device
drivers.  (Back in the eighties, when it was more plausible for PG to do
direct device access, maybe smgr was good for something; but no more.)

It's interesting to speculate about where we could draw an abstraction
boundary that would be more useful.  I don't think the MySQL guys got it
right either...

                       regards, tom lane

Re: Hadoop backend?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:

Re: Hadoop backend?

От:
"Jonah H. Harris" <jonah.harris@gmail.com>
Дата:
On Sun, Feb 22, 2009 at 3:47 PM, Robert Haas <robertmhaas@gmail.com> wrote:
In theory, I think you could make postgres work on any type of
underlying storage you like by writing a second smgr implementation
that would exist alongside md.c.  The fly in the ointment is that
you'd need a more sophisticated implementation of this line of code,
from smgropen:

   reln->smgr_which = 0;   /* we only have md.c at present */

I believe there is more than that which would need to be done nowadays.  I seem to recall that the storage manager abstraction has slowly been dedicated/optimized for md over the past 6 years or so.  It may even be easier/preferred to write a hadoop specific access method depending on what you're looking for from hadoop.

--
Jonah H. Harris, Senior DBA
myYearbook.com

Re: Hadoop backend?

От:
Andrew Chernow <ac@esilo.com>
Дата:

Re: Hadoop backend?

От:
Markus Wanner <markus@bluegap.ch>
Дата:

Re: Hadoop backend?

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:

Re: Hadoop backend?

От:
Josh Berkus <josh@agliodbs.com>
Дата:

Re: Hadoop backend?

От:
Ron Mayer <rm_pg@cheapcomplexdevices.com>
Дата:

Re: Hadoop backend?

От:
Robert Haas <robertmhaas@gmail.com>
Дата:

Re: Hadoop backend?

От:
Robert Haas <robertmhaas@gmail.com>
Дата:

Re: Hadoop backend?

От:
Robert Haas <robertmhaas@gmail.com>
Дата:

Hadoop backend?

От:
Paul Sheer <paulsheer@gmail.com>
Дата:

Re: Hadoop backend?

От:
Paul Sheer <paulsheer@gmail.com>
Дата:

Re: Hadoop backend?

От:
Paul Sheer <paulsheer@gmail.com>
Дата:

As far as I can tell, the PG storage manager API is at the wrong level
of abstraction for pretty much everything.  These days, everything we do
is atop the Unix filesystem API, and anything that smgr might have been


Is there a complete list of filesystem API calls somewhere that I can get my head around?
At least this will give me an idea of the scope of the effort.

> should be easier to build postgres data feeder in Hadoop (which might even already exist).

do you know of a url?

-paul



Re: Hadoop backend?

От:
Hans-Jürgen Schönig <postgres@cybertec.at>
Дата:
why not just stream it in via set-returning functions and make sure that we can mark a set returning function as "STREAMABLE" or so (to prevent joins, whatever).
is it the easiest way to get it right and it helps in many other cases.
i think that the storage manager is definitely the wrong place to do this.

it is also easy to use more than just one backend then if you get the interface code right.

regards,

hans


On Feb 24, 2009, at 12:03 AM, Jonah H. Harris wrote:

On Sun, Feb 22, 2009 at 3:47 PM, Robert Haas <robertmhaas@gmail.com> wrote:
In theory, I think you could make postgres work on any type of
underlying storage you like by writing a second smgr implementation
that would exist alongside md.c.  The fly in the ointment is that
you'd need a more sophisticated implementation of this line of code,
from smgropen:

   reln->smgr_which = 0;   /* we only have md.c at present */

I believe there is more than that which would need to be done nowadays.  I seem to recall that the storage manager abstraction has slowly been dedicated/optimized for md over the past 6 years or so.  It may even be easier/preferred to write a hadoop specific access method depending on what you're looking for from hadoop.

--
Jonah H. Harris, Senior DBA
myYearbook.com



--
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt

FAQ