Just curious... couldn't you simply build or use one of the existing Database filesystems that work with Fuse? Then you could mount a filesystem whose backend is Postgres.<div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div><a href="http://sourceforge.net/apps/mediawiki/fuse/index.php?title=DatabaseFileSystems">http://sourceforge.net/apps/mediawiki/fuse/index.php?title=DatabaseFileSystems</a></div></blockquote><div><br></div><div>The postgres FUSE project seems to be dead, but these seem to be pretty simple to create. This would mean that all existing tools such as Cacti would not need any changes and migrating to such a setup would require only a cp /olddirectory/* /sqlbackeddirectory/</div>
<div><br></div><div>I would hope that a database backed filesystem would also be able to take advantage of filesystem caches at the OS-level which might be a free performance gain.</div><div><br></div><div>Good luck,</div>
<div><br></div><div>Anthony</div><div><div><br><div class="gmail_quote">On Tue, Sep 11, 2012 at 7:44 PM, Dustin Fisch <span dir="ltr"><<a href="mailto:fooker@lab.sh" target="_blank">fooker@lab.sh</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
Tobias Oetiker <<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>> wrote:<br>
<br>
> Hi Dustin,<br>
><br>
> Yesterday Dustin Fisch wrote:<br>
><br>
> > Hi,<br>
> ><br>
> > I am currently thinking about building an RRD extension for<br>
> > PostgreSQL.<br>
> ><br>
> > The extension will provide a RRD data type which represents a<br>
> > complete database and functions for all the existing functions of<br>
> > the RRD tool, like create, update, first and graph...<br>
> ><br>
> > PostgreSQL has a nice API for LOB, which allows to store the whole<br>
> > RRD database using the PostgreSQL file management.<br>
> ><br>
> > I already have taken a look to the RRD code. As far as I can see,<br>
> > there are functions like rrd_create_r(...) which provides the<br>
> > functionality I need for such an extension.<br>
> ><br>
> > The PostgreSQL LOB API currently provides a file descriptor for the<br>
> > access to the data stored in the LOB.<br>
> ><br>
> > Unfortunately, it looks like the RRD API only allows the usage of a<br>
> > filename.<br>
> ><br>
> > Is there any way to use a file descriptor instead of the filename?<br>
> > Or is there any chance such a patch would be accepted?<br>
><br>
> if done nicely, I'll be glad to integrate such a patch ... I guess<br>
> you would have to compile without mmap support ...<br>
</div>I'm not sure about mmap. I think I have to try it.<br>
<br>
The plan for the patch is to refactoring the rrd_*_r methods by moving<br>
out the real work of the method into something called rrd_*_x. The only<br>
thing remaining in the original method are the calls to rrd_open and<br>
rrd_close and the call to the new method.<br>
<br>
The new rrd_*_x methods will mirror the interface of there rrd_*_r<br>
counterparts expect the filename parameter, which will be replaced by<br>
the already opened rrd_file_t.<br>
<div class="im"><br>
><br>
> how would this pg integration work, would the rrd data be stored in<br>
> a blob ? wouldn't this get read from disk entirely on every update<br>
> and make things rather slow ?<br>
</div>Right. The idea is to store the RRD data in a BLOB.<br>
<br>
But I don't see any performance problem with this as a PostgreSQL<br>
extension is allowed to work on the file backing the BLOB directly<br>
using a file descriptor.<br>
<br>
This makes no difference to the way RRDtool currently works. Maybe this<br>
allows to to use the current mmap code, too.<br>
<br>
><br>
> cheers<br>
> tobi<br>
><br>
><br>
<br>
cheers<br>
fooker<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
<a href="http://lab.sh" target="_blank">http://lab.sh</a><br>
</font></span><br>_______________________________________________<br>
rrd-developers mailing list<br>
<a href="mailto:rrd-developers@lists.oetiker.ch">rrd-developers@lists.oetiker.ch</a><br>
<a href="https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers" target="_blank">https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers</a><br>
<br></blockquote></div><br></div></div>