[aida] Post Tutorial comments - Magma persistency

Janko Mivšek janko.mivsek at eranova.si
Wed Apr 20 22:47:03 CEST 2011


On 18. 04. 2011 06:54, Elliot Finley wrote:

>>> #2) UrlResolver: This is slick in a small tutorial but doesn't it mean
>>> I can not scale past a single image?  It seems like it would also mean
>>> I have to use image persistence because the urlResolver is holding a
>>> reference to all the objects.  I'm hoping I'm way off the mark here.
>>
>> URLResolver is only one of possible resolvers and you can add you own of
>> you really need it. There is a WebRouter where you can register an
>> additional one and where you can see some more already. URLResolver
>> itself is also a two way resolver: url->object and also very important
>> object->url. Later is what makes navigation in Aida apps so easy so
>> powerful.
> 
> Looking at URLResolver, it looks like if I want to scale past a single
> image, I would need to persist allWebPages and allURLLinks to my
> database (Magma for example).  The only problem is allWebPages is an
> identityDictionary.  The identity will change each time it is brought
> in from the database.

Yes, in case of ODB persistence the best way is to persist all AIDASite,
even more, start with SwazooServer then cut the persistence for things
that are transient. In SwazooServer #servers instvar, in Aida session
application state (instances of App classes in WebSession instvar
#appsForObjects), etc.

I have similar solution developed for Gemstone (GS) on VisualWorks (VW)
(not GLASS) long time ago, in this case GS objects are replicated to VW
image. GS uses special methods with directives on class side to
determine, which instance variables should be made persistent and which not.

I'm pretty interested to use Magma for persistency of Aida based
projects and if you are interested to help here, it would be really
nice. I think also Chris Muller, author of Magma will be happy to help.

Best regards Janko

> 
> Am I looking at this the right way?  If so, do you know of a way to solve this?
> 
>> URLResolver itself is capable to resolve up to about 100K objects, after
>> this it becomes slow because of hashing, specially in object->url way.
>> But funny thing is that I didn't yet got so big web app to need more
>> that so much objects.
> 
> perhaps a btree structure rather than a hash structure?  a little
> slower with few objects but much much faster after the hash starts to
> degrade.
> 
>> URLResolver is also meant for long living objects. For image persistency
>> or GLASS therefore.
> 
> This makes sense but, I'd also like to be able to use Magma as an
> option.  It appears that the only obstacle is the allWebPages
> IdentityDictionary.  I don't know how to persist that in Magma since
> the identity of an object will change each time it's resurrected from
> the database.  Any thoughts on this would be appreciated.
> 
> Elliot

-- 
Janko Mivšek
Aida/Web
Smalltalk Web Application Server
http://www.aidaweb.si


More information about the Aida mailing list