Helma Logo
main list history
previous version  overview  next version

Version 1 by maks on 21. January 2008, 23:59

===Proposal:===

A new, alternative data store for use as Helma's "internal" DB.
The aim is to make it production quality so it could be recommended for  production deployment as well as initial development work.

===Implementation===
* Seperate folder for each Prototype, each folder is named after prototype whose objects it stores
* Each Prototype folder has 10 folders, named "0" to "9". A HopObject whose is stored in the folder that matches the last digit of its ID, eg. in folder "2" you would store object with id: 2, 12, 22,..., 1002, etc.
* Each prototype has its own consecutive ID counter, stored in a file called counter is each prototypes DB sub folder
* Prototypes that extend a Prototype have their own named folder inside the parent Prototypes folder eg. jsdb/User/AdminUser/
* Each file labelled with id of the object JSON format for each file
* use #Prototype(id) for properties that represent other HopObjects
* Because all access goes through JSAdapter get method, first time a property that is a HopObject is accessed, the JSAdapter get method will "patch up" a reference to the correct Helma Object, loading it if necessary. Of course is should also be possible to specify an "aggressive" loading strategy where references are patched up at load time for some Prototypes.

e.g.

  helma-1.6.1/
    /jsdb
        /User
            /counter
                /1
                  /1.json
                /2
                  /2.json
        /List
            /counter
            /1.json
            /2.json
        /Item
            /counter
            /1.json
            /2.json
            /3.json
        /Profile
            /counter
            /1.json
    etc.

/User/1.json :
  {
    name : "fred",
    lists : [#List(1), #List(2)],
    profile : #Profile(1)
  }


     removed
     added