Developers/Egwbase/Timemachine

From Tine 2.0 - Wiki

< Developers
Timemachine and Historylog UML

Timemachine, or more precisely WayBackMachine, is a framework for handling History logging and related tasks. It's purpose is, to become extended by the backend class(es) of the different applications.


Timemachine

Timemachine works on record basis and supplies records as they where at a given point in history. Moreover it answers the question which records have been added, modiefied or deleted in a given timespan.

This are the most important usecases timemachine is designed for:

  • Provide a consistent data view for a given time. This is important for syncronisation engines like syncML.
  • Provide history information, which are needed to implement a sophisticated concurrency management on field basis.
  • Provide datas for record history investigations.
  • Provide datas for desaster recovery.

Egwbase_Timemachine interfaces/classes build a framework, which needs to be implemented/extended by the backends of an application.

As Timemachine could be invoked for sync, but also for concurrency issues, it has to deal with UIDs (string) on the one hand but also with ids (int) on the other hand. If an app does not deal with UIDs (e.g. its not intended to paticipate sync), it has to throw exceptions when a UID handling method gets invoked.

NOTE: Timespans are allways defined, with the beginning point excluded and the end point included. Mathematical: (_from, _until]

NOTE: Records _at_ a given point in history include changes which contingently where made _at_ the end of time resolution of this point

For implementation details consult the api docs.

ModificationLog

ModificationLog tracks and supplies the logging of modifications on a field basis of records. It's an generic approach which could be usesed by any application. Besides, providing a logbook, the real power of ModificationLog depends the combination with the Timemachine.

ModificationLog logges differences of complete fields. This is in contrast to changetracking of other products which have sub field resolution. As in general, the sub field approach offers most felxibility, the complete field solution is an adequate compromise for usage and performace.

ModificationLog is used by Egwbase_Timemachine_Abstract. If an application backened extends Egwbase_Timemachine_Abstract, it MUST use Egwbase_Timemachine_ModificationLog to track modifications

NOTE: Maximum time resolution is one second. If there are more than one modifications in a second, they are distinguished by the accounts which made the modifications and a autoincement key of the underlaying database table.

NOTE: Timespans are allways defined, with the beginning point excluded and the end point included. Mathematical: (_from, _until]

For implementation details consult the api docs.