<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.3.2">
</HEAD>
<BODY>
On Thu, 2005-12-15 at 14:32 -0500, Waldo Rubinstein wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi,</FONT>
<FONT COLOR="#000000">I'm fairly new to Lisp and very new to Elephant. I'm thinking of </FONT>
<FONT COLOR="#000000">developing some apps using UCW and Elephant and was wondering a few </FONT>
<FONT COLOR="#000000">things:</FONT>
</PRE>
</BLOCKQUOTE>
Welcome.
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">1) Is Elephant ready for production code even though it's still on </FONT>
<FONT COLOR="#000000">version 0.3.0?</FONT>
</PRE>
</BLOCKQUOTE>
I intend to use it for production; I wouldn't let an Astronaut's life depend on it.<BR>
I think this is a very difficult question to answer. I worked as a Java programmer for 5 years<BR>
and as a Perl programmer before that; we were always doing things to be more "enterprise ready"<BR>
and believe me, everything has problems. I personally am much more ready to say something<BR>
is "production ready" than others, so I might be the wrong person to answer this. As a fan<BR>
of the extreme programming methodology, I would recommend a "Spike Solution" test ---<BR>
design a simple test that can be rapidly executed to get the information you need.
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">2) How scalable is Elephant? I feel confident that Berkeley DB is </FONT>
<FONT COLOR="#000000">very robust even for large data repositories. But, does Elephant </FONT>
<FONT COLOR="#000000">scale well working with large repositories?</FONT>
</PRE>
</BLOCKQUOTE>
I think so. I am the maintainer, not the author of the original code. I wrote the SQL-based stuff;<BR>
it is slower and possibly has bugs the BerkeleyDB stuff doesn't. It runs my tiny website <BR>
flawlessly, and comes with a suite of tests.
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">3) My application generates a lot of records. Some of these objects </FONT>
<FONT COLOR="#000000">(records) have complex structures (many levels of inheritance and </FONT>
<FONT COLOR="#000000">relations) and some are very flat. The ones that are very flat are </FONT>
<FONT COLOR="#000000">normally very large quantities (at least for me). I may be generating </FONT>
<FONT COLOR="#000000">about 10000 new simple objects on a daily basis. Does anyone have any </FONT>
<FONT COLOR="#000000">suggestion as to the proper storage of these? Would using something </FONT>
<FONT COLOR="#000000">like a btree be efficient enough for fast querying?</FONT>
</PRE>
</BLOCKQUOTE>
The BerkeleyDB system uses btrees. Yes, the btrees offered by BerkeleyDB (and extention by <BR>
Elephant) are very fast, and there is nothing faster except in very specialized circumstances.
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">4) Is there any support for "LIKE" type searches in Elephant? Some of </FONT>
<FONT COLOR="#000000">the queries I currently run against MySQL are along the lines of </FONT>
<FONT COLOR="#000000">WHERE last_name LIKE 'smit%'. I would assume I could create secondary </FONT>
<FONT COLOR="#000000">indices for last_name (as an attribute), but will it allow me to do </FONT>
<FONT COLOR="#000000">"LIKE" searches?</FONT>
</PRE>
</BLOCKQUOTE>
No, there isn't any support for that (that I'm aware of?). You could keep the field that has 'smit*' in<BR>
it in a separate table, and perform a pattern match by loading it all into memory, or calling map-btree<BR>
over it, and then look up the rest of the objects based only on the matches.<BR>
<BR>
Personally, I use Elephant in an "Object Prevalence" style --- that is, I keep all the objects in <BR>
memory by default, and use the Elephant store to recover from bugs and tripping over the <BR>
power cord. Some people object quite emotionally to that style, and worry about running<BR>
out of memory. If you keep things in memory, "like" is easily done in lisp.<BR>
If your object space is very large and you need like, you would probably want to just use CL-SQL directly;<BR>
it is very nice. Elephant saves you from having to worry about SQL and table structures.
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Thanks for your support,</FONT>
<FONT COLOR="#000000">Waldo</FONT>
<FONT COLOR="#000000">_______________________________________________</FONT>
<FONT COLOR="#000000">elephant-devel site list</FONT>
<FONT COLOR="#000000"><A HREF="mailto:elephant-devel@common-lisp.net">elephant-devel@common-lisp.net</A></FONT>
<FONT COLOR="#000000"><A HREF="http://common-lisp.net/mailman/listinfo/elephant-devel">http://common-lisp.net/mailman/listinfo/elephant-devel</A></FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>