The name of this schema pattern

data-warehousedatabase-designschema

Its been a few years… but I've run into a problem-set that reminds me of a schema design pattern and I'm trying to recall the details.

Essentially, the pattern consists of one database which is 3 NF (or something else) that services all Inserts, Updates, and Deletes. On some periodic or event-driven basis it would publish all (or some) of its state to another database which is optimized for high-performance read-only access. Essentially, the publish would generally target a completely different or de-normalized schema.

The question is… Is this a well known pattern? If yes, what is it called, and what are the pitfalls aside from duplicative storage of the same state.

Best Answer

What you are describing is a data warehouse. The live, normalized, read-write system is OLTP (online transaction processing) and the denormalized read-only snapshot is a data warehouse. The structure of the data warehouse could be a Star Schema, especially if it's highly denormalized. Data warehouses often have summarization in addition to denormalization. There can be many copies of the same data summarized over various dimensions and/or timeframes.

The disadvantages of this technique are that the snapshot is generally not 100% up to date and you have to be very careful about how your snapshot is taken or you could actually introduce discrepancies other than timeliness into your data warehouse. Another possible issue is that you may have difficulty doing some kinds of reporting out of a data warehouse because of the choices you made when rolling up details into you summary tables. Also, if your data warehouse has multiple summaries over different timeframes, for example, you have to be careful to keep these consistent with one-another.

The timeliness issue in particular is one you have to be careful about. I've seen users make a change to their online system and then get angry that it didn't show up right away in a report that is run against the data warehouse. Users tend not to know or care about the vagaries of reporting systems.