Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's a good and deep question, which undoubtfully cannot be seriously answered without understanding the types of workloads you will be dealing, the actual queries to be performed (you should profile them!), the variety of information to be versioned, and so forth.</p> <p>But as for a <em>general approach</em>, I'd start with a simple solution which you can experiment with and benchmark. From that specific case study, develop a more robust case that you elaborate using lessons-learnt from your initial attempt.</p> <p>Here is one good example right here: <a href="https://stackoverflow.com/questions/762405/database-data-versioning">Database - Data Versioning</a></p> <p>Other examples exist, and reading your question I believe you need not just the audit trail, but the actual information as well (to be able to return in time to a specific version). </p> <p>In response to your specific question, whether to use triggers, I would approach it differently: have your business logic in stored procedures for <em>Transactional-update/delete</em> etc', which you can later update and make more complex. Why? because it's in "one place" and nothing can get around it, and because triggers are more associated with <em>tables and atomic actions (update, delete)</em> rather than transactions!!</p> <p>For <em>performance</em>, I'd simply mark the active record as part of the update stored procedure (or high level language procedure for that matter), instead of querying for the most recent version.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload