[Owncloud] Fwd: Re: Usage of triggers: ok for OC apps or too risky ?

Christian Reiner foss at christian-reiner.info
Mon Jul 30 15:06:30 UTC 2012


Hello Thomas, Arthur and all, 
thanks for the replies...

> > > On 07/29/2012 02:13 PM, Christian Reiner wrote:
> > > Hello all,
> > > i plan to offer a live monitoring for the occurance of certain events
> > > inside an OC app. These events are already captured by that app, stored
> > > in the database and also offered via a hook. However, since OC is based
> > > on php inside a web server environment the users session is spread over
> > > several processes. I thought of using long polling ajax requests, but
> > > obviously want to prevent having to poll the database at fixed
> > > intervals. Instead, when trying to react more or less immediately on an
> > > event I have to react directly to the event. Since this event is
> > > captured inside another process two options arise: 1. inter process
> > > communication
> > > 2. using triggers inside the database engine
> > > Inter process comminucation is a great thing, however looking at the
> > > operating systems and the various approaches it seems unlikely to ger
> > > this working reliable outside unix like systems. On MS Windows there is
> > > no dbus, phps shared memory extension does not exist and named pipes
> > > are not available. I know there are only few installations of OC out
> > > there, but it would be a pitty to reduce the list of features on such
> > > systems anyway. So I think of using the second aproach: database
> > > triggers.
> > > To my surprise I read that triggers are supported by SQLite these days,
> > > and
> > > the 'real' database servers relevant here all do so as well. So apart
> > > from me having to implement and test that:
> > > does anyone here see a reason against using triggers in OC apps ?
> > > Thanks,
> > > Christian

> > Am Montag, dem 30.07.2012 um 16:36 schrieb Arthur Schiwon:
> > Hey,
> > it depends a bit on what is going to happen in the database. As long as
> > no ownCloud-logic is bypassed by possible write-actions, it's fine i
> > guess.
> > Cheers
> > Arthur

> On Monday 30 July 2012 16:51:25 Thomas Müller wrote:
> Hi,
> I always have bad feelings if application logic is coded in two locations
> (here database and php). In addition making the triggers work properly on
> all supported databases might cause a lot of sql migration code.
> I somehow dislike the idea - mainly due to bad experience in past projects.
> Take care,
> Tom

Ok, Toms reply confirms my stomach aches with that trigger approach. 

Whilst Arthur is certainly right that from an applications point of view the 
only important thing is to make sure that no data under control of other parts 
of the OC framework is silently altered, my question targeted more towards a 
meta layer. 
I used triggers in previous projects, but indeed whilst relying on the luxury 
of not having to port the implementation between different database engines. 

So I guess I have to look for another approach...

Thanks ! 
Christian
-- 
arkascha
[ foss at christian-reiner.info ]



More information about the Owncloud mailing list