/
MongoDBPlugin.txt
69 lines (51 loc) · 3.09 KB
/
MongoDBPlugin.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
%META:TOPICPARENT{name="Plugins"}%
---+!! !MongoDBPlugin
<!--
One line description, required for extensions repository catalog.
BuildContrib will fill in the SHORTDESCRIPTION with the value of
$SHORTDESCRIPTION from the .pm module, or you can redefine it here if you
prefer.
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
-->
%SHORTDESCRIPTION%
%TOC%
---++ Usage
This is an experimental attempt to utilise [[http://mongodb.org][MongoDB]] for all aspects of serialisation in foswiki.
At this point the Plugin is used to populate the MongoDB. All user topic Saves are automatically copied into the MongoDB, and you can batch load using the restHandler:
* %SCRIPTURL{rest}%/MongoDBPlugin/update?updateweb=Main
To update the javascript stored in MongoDB
* %SCRIPTURL{rest}%/MongoDBPlugin/updateDatabase
---++ Technical details
This initial version serialises the internal Meta object directly into _one_ collection, using web.name as a unique index.
In the process showing a proof of concept that works
Sorting works for fields that are strings, but doesn't yet manage to autoconvert to numerical sorting if all fields happen to contain only numerical characters.
---+++ Caveats
1 Your topics (as stored internally in the Meta obj) must be smaller than 4M.
2 the schema is likely to change regularly, so when upgrading, re-importing will probably be necessary
3 tested with foswiki 1.1.0, _not_ trunk
4 the query SEARCH =~ operator is currently not Hoisted to a regex, so is un-necessarily slow (both with and without mongodb)
5 sorting _is_ different, Foswiki magically orders numerically if all the hits happen to be numeric, whereas Mongo treats strings as strings.
6 web order appears to not have been implemented in the general store? so Mongo has to do it somewhere (unit tests have wrong order)
---+++ Metrics
---++++ HTTP reposnse header =X-Foswiki-Monitor-MongoDBPlugin-lastQueryTime=
you can use
=curl -I http://x61/f/bin/view/Lauries/TestQuery1= to get just the header info (foswiki goes through and does a complete render for =HEAD= requests atm.
in combination with Foswiki::Extensions.DebugLogPlugin, you will then be able to see both the time taken to render the topic =X-Foswiki-Monitor-DebugLogPlugin-Rendertime= and the time
the last MongoDB query tool =X-Foswiki-Monitor-MongoDBPlugin-lastQueryTimee=.
---++ Installation Instructions
%$INSTALL_INSTRUCTIONS%
---++ Info
Many thanks to the following sponsors for supporting this work:
* fosiki.com
| Author(s): | Foswiki:Main.SvenDowideit |
| Copyright: | © 2010 SvenDowideit@fosiki.com |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL 3 (Gnu General Public License)]] |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order --> |
| Sept 2010: | restart work using foswiki 1.1 |
| Feb 2010: | initial implementation spike |
| Dependencies: | %$DEPENDENCIES% |
| Home page: | http://foswiki.org/bin/view/Extensions/MongoDBPlugin |
| Support: | http://foswiki.org/bin/view/Support/MongoDBPlugin |
<!-- Do _not_ attempt to edit this topic; it is auto-generated. -->