<br><br><div class="gmail_quote">On Tue, Aug 9, 2011 at 6:46 PM, Chris Hodgson <span dir="ltr"><<a href="mailto:chodgson@refractions.net">chodgson@refractions.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I agree with Mark that if we can come up with a simple design for abstracting the caching API separately from postgres, that it would be nice to be able to test it outside of postgres.<br></blockquote><div><br>I was suggesting to leverage the key/value store implemented by Berkeley DB, not the SQL interface. Regardless of whether you depend on external code or develop it yourself, you're talking about a "key-value store" (exposed by Berkeley DB), or a "dictionary" (Python), or a "Map" (Java/C++). At a minimum, you need to be able to compare key equality, even if you don't do anything crafty with the organization of individual elements (e.g., hashing/sorting).<br>
<br>It's simple enough if to write custom caching code for each data type you want to cache. But if you want polymorphism, you want a language other than C. Implementation of a polymorphic design in a language which does not support polymorphism is going to be anything but simple, and will probably end up looking similar to this: <br>
<br><a href="http://download.oracle.com/docs/cd/E17076_02/html/api_reference/C/frame_main.html">http://download.oracle.com/docs/cd/E17076_02/html/api_reference/C/frame_main.html</a><br><br>I was not able to quickly locate alternative C implementations of "Map"/"Dictionary" in library form.<br>
<br>Bryce<br><br><br></div></div>