Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the pros and cons of Anchor Modeling? [closed]

I am currently trying to create a database where a very large percentage of the data is temporal. After reading through many techniques for doing this (most involving 6nf normalization) I ran into Anchor Modeling.

The schema that I was developing strongly resembled the Anchor Modeling model, especially since the use case (Temporal Data + Known Unknowns) is so similar, that I am tempted to embrace it fully.

The two biggest problem I am having is that I can find nothing detailing the negatives of this approach, and I cannot find any references to organizations that have used it in production for war-stories and gotchas that I need to be aware of.

I am wondering if anyone here is familiar enough with to briefly expound on some of the negatives (since the positives are very well advertized in research papers and their site), and any experiences with using it in a production environment.

like image 642
Chuu Avatar asked May 04 '12 22:05

Chuu


2 Answers

In reference to the anchormodeling.com

Here are a few points I am aware of

  1. The number of DB-objects is simply too large to maintain manually, so make sure that you use designer all the time to evolve the schema.

  2. Currently, designer supports fully MS SQL Server, so if you have to port code all the time, you may want to wait until your target DB is fully supported. I know it has Oracle in dropdown box, but ...

  3. Do not expect (nor demand) your developers to understand it, they have to access the model via 5NF views -- which is good. The thing is that tables are loaded via (instead-of-) triggers on views, which may (or may not) be a performance issue.

  4. Expect that you may need to write some extra maintenance procedures (for each temporal attribute) which are not auto-generated (yet). For example, I often need a prune procedure for temporal attributes -- to delete same-value-records for the same ID on two consecutive time-events.

  5. Generated views and queries-over-views resolve nicely, and so will probably anything that you write in the future. However, "other people" will be writing queries on views-over-views-over-views -- which does not always resolve nicely. So expect that you may need to police queries more than usual.

Having sad all that, I have recently used the approach to refactor a section of my warehouse, and it worked like a charm. Admittedly, warehouse does not have most of the problems outlined here.

I would suggest that it is imperative to create a demo-system and test, test, test ..., especially point No 3 -- loading via triggers.

like image 84
Damir Sudarevic Avatar answered Nov 15 '22 05:11

Damir Sudarevic


With respect to point number 4 above. Restatement control is almost finished, such that you will be able to prevent two consecutive identical values over time.

And a general comment, joins are not necessarily a bad thing. Read: Why joins are a good thing.

One of the great benefits of 6NF in Anchor Modeling is non-destructive schema evolution. In other words, every previous version of the database model is available as a subset in the current model. Also, since changes are represented by extensions in the schema (new tables), upgrading a database is almost instantanous and can safely be done online (even in a production environment). This benefit would be lost in 5NF.

like image 8
Lars Rönnbäck Avatar answered Nov 15 '22 03:11

Lars Rönnbäck