Showing posts with label Debt Categories. Show all posts
Showing posts with label Debt Categories. Show all posts

Monday, October 8, 2018

Adding Costs

Next step in our "Why do I care?" discussion is putting some teeth into the analysis: The sharp, serrated, layered-like-sharks-teeth of cost.

Many of my readers work in environments where costs are studiously and purposefully ignored - we're in a post-accountability environment in many organizations right now, where bad design is assumed to be something that gets fixed after the IPO and/or when the adults get hired.  But I think there's still a lot of utility in figuring out how to measure the value of good design in data management.  Most of us don't work for Unicorns, and if you're doing data management you've got an interest in both getting a reliable system in place first, so you don't have to wake up at 2AM to fix problems that'll be spotted in the daylight, and second because actual people actually depend on your systems.  This is true whether you're curing cancer or shipping kombucha starter kits, or even curing cancer by shipping kombucha starter kits.

This is the Ideal Case for the use of a semantic asset:


The semantic asset is some discrete package of data that is (a) repeatable and (b) meaningful to its target.
Repeatable: The asset can be reproduced, even if there's a lot of steps or its composition appears to vary in quality from one period to the next. 
Meaningful: The asset has some value to the target.  It may or may not be Actionable!!l!l1, but there's someone somewhere who's waiting to consume it.
That is, the target knows what the pieces of the asset mean - whether those pieces are structured hierarchically, relationally or whatever.  And the target doesn't have to guess each time s/he receives the asset as to its meaning, as well, because the structure is stable.  An unreliable semantic asset is its own kind of hell, but not one we'll deal with today.

"Meaningful" doesn't mean the asset is simple, and there can be all kinds of rules about dealing with variations in structure, or what variations mean.  But for the asset to be meaningful to the target the target needs to know how to figure out the meaning.  If there are suddenly fields tacked on to the asset that the target hasn't seen before then they literally don't know what they're for.  And if fields are renamed or replaced and the target isn't made aware of the change then once again they literally don't know what they're for.  This might seem like ETL 101, but you'd be surprised how often even supposedly experienced developers don't get this.

In practice this is a matter of communication.  Seems pretty simple, right?  When you change your outputs you should tell the people who use them, and when you get inputs you're obligated to use but can't you should tell the people who produce them.  I once worked for a Supply Chain VP who asked each unit to map their "inputs" and "outputs" in front of the actual people who were their inputs and outputs; these very smart people, used to thinking longitudinally about their responsibilities, suddenly understood the actual scope of their decisions.  BI/DW teams are usually much more aware of their information supply chains, simply because they're much shorter - the teams are usually so small that there's at most two people between a source and the executive using the report.  But even when there's only one person to talk to about the structure and management of a particular semantic asset, things still get screwed up.

In practice this is also a matter of degree.  If you're moving JSON from some kind of document store to a relational db then the entire process is automated with as much pre-formatted input as possible, or you'll never make it work.  Heroism isn't even an option.  If you're sending a spreadsheet to someone in Finance in response to an ad-hoc request, but you've worked with the recipient a lot, then automation and change management is unnecessary.

This is the Actual Case:


Its a little more complicated.  The target gets an asset that isn't what s/he needs.  It may differ from the ideal asset in four ways.  It may also be somewhat more unreliable than s/he needs - its not as repeatable as spec'd, for example, because sometimes it arrives at 6AM and sometimes at 9AM, but its critical input into a process that starts at 7AM.  It may not be as meaningful as necessary too; the asset is missing rows or fields, or sometimes there's a whole presentation layer that seems to have been forgotten, or sometimes a field that's supposed to mean one thing means something else entirely.

So how do we close the gap between What she needs and What she gets?  Its not that hard to figure out how much it would cost to close the gap.  We can itemize the tasks and get estimates on analysis, ETL and visualization from our BI/DW team.  That tells us what our estimate is, and there aren't many modern BI teams that don't have a fair degree of facility with that kind of estimation.  In fact some teams have gigantic lists of these things, carefully sorted and prioritized.  But that list and its associated estimates is the dollar value of the organization's semantic debt.

A couple of points.  First, you might wonder which category of debt is more expensive.  There's Equivalence debt and Coverage debt, as you may remember.

Equivalence debt occurs when you've got two assets that need to be merged.  It may be, for example, that What she gets is a report about "Bounced emails by campaign" from the old ESP, and What she needs is a report that merges the Bounced emails reports from both the old and the new ESPs.  The asset might then be in both Type 1 and Type 2 debt; the former if the schemas are different between the two sources, which is virtually certain, and the latter if there's two sets of natural keys between the two as well.

Coverage debt occurs when What she gets lacks the data necessary for the operation its used for.  Consider an asset consisting of the analysis of log data, fed from a device that seems to be functioning correctly.  The analysis of the data requires some series of positive steps required to produce it: Sum these fields, count distinct values in those, transform that field using this xref so it shows these categories, and so on.  Those analytical steps will have some defensive code built in, if they're built by anyone with any experience at all, so e.g. NULLs will get tossed from sums or counts or even xref matches.  All of those rules add up to a model of the log data, a set of assumptions about how the data behaves that help transform the data into something meaningful at the target.  We have coverage debt when there's stuff happening in the log data that isn't accounted for in the model.  It might be as simple as the sudden appearance of negative values in a field where the "sum" operation doesn't expect them, leading to lower-than-expected sums that make the summary suspicious.  Or it might be that values in category fields start showing up that aren't in the xref, and so the asset breaks mysteriously or ignores those values.

So which is more expensive?  It depends on the state of your BI team.  I know "it depends" is the most useless phrase in modern English, but here's how I think it works.  Equivalence debt is easy enough to fix with an experienced developer, especially someone who's got a lot of experience with SQL.  If you've got someone who knows their way around the two sources (or even just one of them) then they can generally work out identity conditions (for Type 2) or schema-equivalence queries (for Type 1) pretty quickly.  Sometimes of course the two sources can't be reconciled, and so everyone chases down a rathole for six months doing something like "the Philosophy of Order Management." (See the beginning of this post for an example.)  But you can, as a BI Manager, probably figure out roughly how long it would take your junior people to resolve a case of Type 1 debt vs. asking the more senior people to do so.

Coverage debt is harder to resolve because its a different kind of uncertainty.  In the example we used above, of the log data shoved into a summarizing report, you could easily produce an exception report that showed data that was ignored by the first summary; so e.g. strings in the source that don't match strings in the xref.  How expensive would such a report be?  Probably not that much, and it would help you avoid all three Failure modes.  That is, there's no immediate failure, because you've covered both the requirement and an open-ended asset for everything not in the requirements.  There's no sudden failure, because the open-ended asset will tell you if something happens in the log data that you didn't expect.  And there's no gradual failure, at least not if you stay on top of accommodating unexpected results shown in the exception report into the main summarization.

But most coverage debt isn't so easy.  What happens if there's no easy way to accommodate unexpected results?  Maybe that's because there isn't anyone who knows what they mean - i.e. you get values in the log that may or may not be by design, but since there's no one who knows the design no one knows what they mean.  I suspect all device-generated data has this problem eventually; not necessarily because there's new error codes or easter eggs, but because time has a way of making us all operate outside our operating parameters. 

In those cases, the cost is much more open-ended.  You can hire a data architect to design you an customer-event reporting system, for example, but if there are complex or unknown event types in your organization the process is going to be something of a fishing expedition.  Many "Customer 360" programs falter when they start to look at the details of customer behavior, for example.  You know they bought something and you know they bought something again, but all the interactions you've got with them between those two events are locked up in your weblog-reporting systems, or uninstrumented, or god forbid lost to time forever.  Or they live in systems no one has access to, or that are generally ignored - for example, the physical plant of your ecommerce system, which may have various moments of unreliability that explain why "add to cart" trends are so spiky.
   
I think its generally easier to deal with Type 3 coverage debt - underdetermined schemas - using the open-ended "exception report" method on a single source.  In fact I think its a good way to turn junior developers into intermediate ones, because it forces the developer to think of what they don't know about the source and the role the source plays within the business.  But when it comes to larger, more diverse sources or Type 4 debt, the costs to fix it are going to be larger simply because it takes more time and the resolution is not necessarily determinate.

Add up all of these interval costs and you get your total semantic debt:







Tuesday, September 18, 2018

How to use the Semantic Debt Problem Matrix to solve problems

So how do you use the giant matrix I put up yesterday?

An analytical matrix is a model of the world.  This idea shouldn't be new to anyone who reads stuff like this, but let me explain a little further.

(I'm going to switch the names around here so anyone who's followed this closely might get a little confused for a moment.  I don't think anyone is actually following any of this that closely anyway, but the names of the axes have been bugging me for a while and I don't think they fit.  So I'm going to change them to something more appropriate.)

What I've proposed is that you can classify all of your data management problems using a 2X3 matrix.  The Y axis of the matrix is the Debt Category, which breaks down as follows:


 
My claim is: If you look around your data management shop you'll find you've generally got people working on two types of problems. 

  1. They're trying to solve Equivalence problems: They're writing reports or building pipelines or ETL processes that combine different schemas (Type 1) or resolve different natural keys (Type 2).  
  2. They're trying to solve Coverage problems: They're trying to figure out the schema for a set of files or a storage system (or trying to enforce governance rules on the same), or trying to figure out how to store something in an existing schema.
In a more traditional data management team this work is done by BI analysts and ETL developers.  In a data science group individual data scientists will wrestle with all four problems.  In a large enterprise group there may be a team of business analysts working on one problem at a time, and then handing off what they've found to specialists.

But - and this is very important! - each team will only ever have one of these four types of problem.  They're either working on how to glue two sets of data together, or they're trying to figure out what the data means.  Sometimes you need to do the one before the other, but this is all there is.

By the way, there's no real division of labor here.  Its not as if BI people are hired to work on Equivalence debts and ETL people work on Coverage debts, because they don't.  In the course of building a report a BI analyst will have to figure out what a schema means, often by analyzing apparent natural keys, and then figure out how to merge the schema with something they've already got.  The ETL people do exactly the same thing.  The primary difference between BI and ETL is that one person's output is a visualization (which might just be a table) and the other is a table or file.  If you're a data scientist then you're doing both jobs - but hey, they're calling you a scientist so that's worth something, right?

So there's only ever four kinds of problem that data management people wrestle with.

The second claim is that there's only three ways the data management team discovers they've got these problems.  They can be surprised by them (duh!), in which case they've got a Sudden failure.  They can know about them because they're a consequence of the design or scope of the systems they work with, in which case they're Immediate failures.  Or these failures can build up gradually, where no one specific failure is significant enough to be a Sudden failure but over time enough debt builds up to cause a problem.  These are Gradual failures.  These Failure Modes are our X axis.


So this is it, is what I'm claiming.  You can design your fancy stateless ETL solution around this matrix, hire people who specialize in one kind of debt or another, or go out and make a lot of consulting cash analyzing an organization's data management plans using this matrix.

But its not enough for Erin and people like her, which is to say everyone who doesn't live a life of enforced leisure such as myself.  So the next step is to cross-reference the matrix with the problems it solves, as follows:


Now that we've got the dimensions for the cube and we've filled in the cells with corresponding problems, we can flip the matrix around and figure out what to do with our problems.  To use the Index, you look up your problem, determine which Debt Category and Failure Mode its an example of, and then apply the mitigation.

Solving Coverage problems takes a specific kind of skill, one that's very different from playing around with fields to figure out an appropriate natural key.  If you've got a lot of Type 2 debt you're better off looking for someone with a lot of business knowledge to help glue schemas or keys together than you are asking a newly-hatched BI analyst to solve the problem.  If most of your problems fall into the Equivalence category you should build or expand your Data Lake (or build something more sophisticated - ask me how!) so you can start to work on the semantic components you're going to turn into joins.  On the other hand, if you're anywhere in the vicinity of the Blackberry situation you need to rethink your conceptual model.

You can find a more readable version of the Problem Index here

The point of this blog

Welcome to the beginning of the film

In the twenty-plus years I've worked in data management I've spent a lot of time having some version of the following conversati...

Top 3 Posts