Stored Data

Every organization, every solution, every system stores data. Your phone (a solution) stores data: Your phone numbers are data, your messages are data, your banking app stores data, your to-do list is data, your calendar, your settings, your notes … the list is endless .

We process data all the time. When you make a payment using a card, phone, or watch, you are processing data. The data representing your money is moved from your account to the recipient’s account. When you look at your card statement, you are looking at stored data that has been processed and stored for every transaction in the past month .

Data is all around us; it is part of every problem space and solution. Knowing more about it helps you learn more about the processes that surround the data, as well as the requirements for the processes and the data .

Data and process are joined at the hip. You can’t have one without the other. There is no such thing as data that is not processed; there is no process that is not processing data. Both have requirements, which is what we are interested in here .

Before going too far into this, we have to say that the business analyst is not designing a database. The business data models that we are discussing here are input to the database design process, but for the moment, let’s talk about the business data .

As we are concerned only with business analysis, we shall stick to modeling the essential stored data. Also, because we are concerned with business analysis and requirements discovery, we are using a simplified notation for our data models. You will also come across class diagrams (from UML), entity relationship diagrams, and other notations. By all means use those if your company so decrees, but the models you see here are sufficient for your trawling .

When you are trawling, you are usually trawling for business processes. All processes use data one way or another, so discovering the data is a way of discovering the processes. Alternatively, discovering the processes also discovers the needed data .

Let’s look at stored data and how it is connected to requirements .

Data Models

Data models are an abstraction of the real world. A data model is made up of entities that reflect real-world things. (You can use the UML term “classes” if you prefer.) In the real world, things are connected, so the data model shows relationships (associations in UML) between the entities. For example, you have a bank account—a thing—and it is linked to your debit card—another thing.

These things can be represented by data. The debit card has a number, your name, expiry date, CCV, and so on. These data items—we’ll call them attributes —belong to an entity, which naturally enough you would call Debit Card . Your bank account also has an identifying account number, account balance, and so forth. Because it is a thing that is uniquely identifiable, it too is an entity. When you buy something, the transaction must be recorded (another entity) so that the transaction amount can be debited from your bank account.

If you are trawling this business, the aforementioned things become entities on your data model.

Entities don’t stand alone; they are linked to other entities by relationships . Relationships represent some real-world associations needed by the business. These relationships are established by business processes. For example, when your bank issued you a debit card for your account, it established the relationship between the card and the account. When you use your card to buy something, the transaction has to be linked to your card and your bank. Figure 23.1 shows the resultant data model.

Images

Figure 23.1

Three entities and the relationships that model the activity of your debit card

The big deal about data models is that by trying to build one for the data stored in your problem space, you have to discover the data entities and how they relate to each other. It is by questioning what the data is and how the pieces are linked that you discover more about the business you are investigating.

Let’s look at an example. Some countries are introducing charges for heavy trucks using their highways. This is beginning to happen in European countries, but it is a possibility for some cash-strapped states in the United States to raise a little revenue from trucks driving through interstates within their borders. The countries or states do not want to install toll barriers—barriers slow down traffic. Instead, they probably want some electronic sensing system to detect trucks on their highways.

Let us say that you are trawling this piece of business to find its requirements. These requirements will eventually be used to construct a (probably automated) solution.

What entities spring to mind? Truck is an obvious one, as is Road . You need these two because you are charging the truck for using the road. The entities on the data model are not themselves data—they have no alphanumeric value—but they can be thought of as “containers for attributes.” Attributes are the individual items of data that have an alphanumeric value: a date, an amount of money, a name, the price of something. Each attribute must belong to its relevant entity. You can’t have an attribute of, say, credit card number, in an entity called Stock Item .

The entity Truck would have attributes including the license plate number, the country or state issuing the license plate, the type of truck, its weight, and so on. This entity on your data model represents not just a single truck, but all the trucks that may use the roads. This is why the word “class” can be used to refer to entities; it’s the class of the thing of which there are many instances. Because there are many of these things, each one must have a unique identifier. In this case, the license plate together with the country or state of issue identifies an individual truck. By the way, you need the state or the country as part of the identifier, as it is not beyond the bounds of possibility that a plate from one state could have identical characters to that from another.

The next data entity to represent a real-world thing is the Road . The Road would have data attributes such as a road identifier—Interstate 70, county road 57, European or national road numbers —and some geographical data, permitted uses, and so on. The road identifier is needed because there are lots of roads in the problem space.

Now we have to link these two things. However, they don’t directly relate to each other for the purpose of this business. Sure, a truck can drive on a road and a road can carry a truck, but the business charges for each instance that a truck uses a road. This means we need another entity, this one a conceptual or intangible one, which we call Journey . See the partial model in Figure 23.2 .

Images

Figure 23.2

The partial data model reflecting the narrative of the business as we have it so far

There is more of this model to come, but let’s pause here and consider what we have. Keep in mind that we are trying to understand a business and find its requirements by building a model of the data that it stores.

So far, we have three entities on this model; Road and Truck are obvious. The third entity, Journey , needs some explanation.

A truck will drive along many roads, and a road will carry many trucks. When you investigate the business, you find that it needs to keep track of which truck drove along which roads. This is data and thus needs an entity to store it, so you create the Journey entity to contain it. Naturally enough, there has to be a new instance of Journey created whenever a truck drives on a road.

The lines between the entities represent the relationships (associations in UML terminology) between them. Note the characters attached to the relationship line: “1” means a single instance, and the “*” means many instances of the entity.

An instance of Journey can belong only to one Road —you can’t be simultaneously using several roads—whereas over time a road will experience many instances of Journey . An instance of Journey can only be created by a single truck, but the truck will use roads many times, and for each time there must be a new instance of Journey to record that particular usage.

To show this you put an “ * ” at the Journey end of the relationship, and as there can only be one Truck making an individual journey, you mark the Truck end of the relationship with a “1”. Similarly, an instance of Journey can only be made on one Road , but a Road will be used many times, so that is tagged with a “1” and a “ * ”. It’s easier to call this a “one to many” relationship. These cardinality (or multiplicity ) notations are there to tell you a little more about the business.

Let’s get on with the requirements for this piece of work. The data model and the business policy are mirrors of each other. To carry out the policy, any business needs data. You can find functionality by finding the data, or having found some data, determine the functionality that uses it.

You interview the road authority and ask about their business policy for charging for a Journey . Do they charge for the distance a truck travels on a road, or the time spent on the road? Does the weight of the truck come into the charging calculation? Does the truck’s cargo affect the charge?

The answers to these questions bring a need for data.

The road authority tells you that they intend to charge for the distance traveled on a road, which is probably the most viable way to do it. However, roads can be very long—hundreds or thousands of miles/kilometers—and a truck might not traverse the full distance. Ideally, you would charge the truck from the exact point it entered the road to the exact point it left the road. However, to monitor every possible entry and exit from a highway would be prohibitively expensive and problematic. The stakeholders tell you that there are already gantries (or overhanging signs) erected across roads to provide signage—distances to cities along the way, upcoming exits, traffic conditions, and so on. As these exist, they have known geographic locations, and it is probably feasible to add scanners to monitor truck activity. This means the gantries can be used as checkpoints for measuring distance. It is not as precise as entry/exit monitoring but is deemed to be good enough. A scanner every 50 miles or so would be sufficient.

Now we need more data, specifically about the Gantry . When a truck passes its first gantry it establishes a new instance of Journey , which is attached to the Gantry entity. As the truck passes subsequent gantries, they too are attached to the Journey entity. This continues until the truck stops passing gantries and the distance traveled can be calculated. Figure 23.3 shows the revised data model.

Images

Figure 23.3

This version of the data model introduces the gantry. Gantries have scanners attached to detect trucks. The gantries are needed to determine the distance of a truck’s journey on a road.

The data model is mirroring the business policy. It also gives you requirements. For example, there is now a requirement to establish the gantries in the solution. There will in fact be a new business event to establish a gantry, and another to delete it, change it, and so on.

Similarly, the data attributes of Journey need to be used (you cannot have data that is not processed, just as you cannot have a process with no data). The attribute Distance Traveled is the basis for charging. From the relationships, you know which truck made the journey and which road was used. This information is used to send out an invoice. Your solution must retain a history of the invoices, so more stored data in the form of another entity is needed. This one is attached to Journey because that is what you are billing for.

Images

You are discovering requirements, either by deriving them from a data model or by using the data model to drive your discovery. Let’s question the cardinality of the relationship between Journey and Invoice . Is it—reading left to right—one to one, meaning that one invoice is sent for one journey (i.e., as soon as the truck’s journey has ended, an invoice is generated)? Or is the cardinality many to one, meaning that one invoice is sent for a collection of all the journeys a truck made within a billing cycle? You go back to the stakeholders to discuss this. It’s an issue you have to resolve, as it would be easy to presume the wrong approach. You write your requirements for whichever approach is selected.

Then we have the problem of the invoice—who exactly is invoiced? You can’t send an invoice to a truck, so presumably it must go to the truck’s owner. Now it becomes more complicated. Some—probably most—of the truck owners are large haulage companies and have many trucks. Should the authority send an invoice for each journey, or for all the journeys the owner’s trucks have completed in the billing cycle?

Consider the data model as it is shown in Figure 23.4 . This represents what we know so far on the business policy and the data needed to support that business policy. If the road authority had wanted to charge for the weight of the truck, then more data would be needed as an attribute of the Truck entity. Additionally, if the truck’s cargo influences the road-charging calculation, we would need another entity called Cargo with a relationship with the Truck .

Images

Figure 23.4

The completed (so far) data model of the road-charging business

But let’s leave it here. The point of the exercise is that you can discover the stored data and the functionality needed to process that data at the same time. And discovering one helps you discover the other.

You can discover the stored data and the functionality needed to process that data at the same time. And discovering one helps you discover the other.

Business Events

Business events are significant to the data model because it is business events that bring data into our solutions, and then later process the data and send it to the outside world . These flows of data into and out of the business area are shown on the context model (see Figure 23.5 ). Each flow on this model is connected to a business event.

Images

Figure 23.5

The context model for the road-charging problem space

This is a simplified view of this piece of work; the real thing is much more complicated. However, this will suffice for our purposes.

An important business event occurs when a truck passes a gantry. We can assume that the gantry scanners have license plate recognition technology to identify each truck as it passes. This business event triggers the incoming flow Truck Detected , the data of which would include the truck license plate number, the time the truck passed the gantry, and probably more. The response to this business event is to create a new instance of the Journey entity, or to update the Journey entity if one had already been created by the truck passing an earlier gantry on this road. The Journey entity is linked to the Truck and Gantry entities. These will later be used to calculate the invoice.

The business cannot magically know about trucks, so the trucks have to be registered. This is another business event that establishes the Truck entity and connects it to the Owner . This ownership needs to be established if the business is to send the right invoice to the right owner.

Another business event would establish a new owner, and so on. Following is the list of business events derived from the context model, in no particular order:

  1. Owner wants to open an account

  2. Owner wants to register a truck

  3. Truck passes a gantry

  4. Time for invoices to be sent

  5. Road Maintenance builds a new road or changes one

  6. Road Maintenance installs a scanner in a gantry

Hang on to that for a moment while we look at the CRUD check.

CRUD Check

The CRUD check— Create Read Update Delete —is used to ensure that you have all the business events, and that all the data entities are relevant and correctly used. It works like this:

Every entity must be Created . They don’t magically fall out of the sky; they have to be created and it takes a business event to create one. Creating an entity makes no sense unless it is used, so there must be at least one business event to Read the entity. Some of the entities are Updated (by business events) and some might be Deleted (also by business events). So, we are using the entities from the data model and the business events to build the CRUD table.

At this point, let’s take a small diversion.

You don’t have to build the data model to find the entities. As previously mentioned, an entity is something that is identified. It is also a thing that itself has no alphanumeric value, but attributes of data with values are attached to it. This means you can make a list of the entities by looking for things in the problem space that are identified and about which data is kept. For example, an account always has a unique account number. A truck has a license plate and state of issue, which uniquely identifies any truck. Roads have numbers and the authority has data about them. All these things are entities, and you can build a CRUD table by simply listing them. End of diversion.

Next, you populate the CRUD table by listing all the entities in the first column. Then, ask what business events process it. All data must be processed in one way or another, so you’re asking which business event creates, reads, updates, or deletes that entity of data.

Figure 23.6 shows a populated CRUD table. It uses the entities from the data model shown in Figure 23.4 and the business event numbers from the list above.

Images

Figure 23.6

The CRUD table showing the entities and the business events that create, read, update, or delete them. This table is complete with what you know to date. As you progress with your investigation, you will fill in more of the table.

The CRUD table is a check of the completeness of your knowledge to date. Its purpose is to find any missing business events and data entities. For instance, the table shows that the Account entity is created by business event 1 when an Owner wants to open an account so that her trucks can legally use the roads. It is read by business event 4 when it is time for the invoices to be sent.

We have intentionally omitted the housekeeping business events. These are things like Owners changing their details—address, company name, and so on. We have left out all the deletions—a gantry is removed, an account is closed, a truck is taken out of service, and so on. These are omitted to make it easier for you to see what is happening by not having cluttered models. But you can expect your models back at work to be more cluttered.

If you look through the table, you can see the combination of business events and data entities that complete the work of this piece of business. Or not quite. Note that there are some blank cells on the table. These indicate that something is missing.

For example, the Invoice entity is created by business event 4, but there are no other events that use it. Data that is created should be read; otherwise, it has no purpose. In this case, the lack of a read business event can be explained if there is another solution—say, an adjacent accounting solution—that uses the Invoice entity. Otherwise, the blank cell would indicate a missing business event.

The Gantry entity is neither updated nor deleted—we said we have omitted the housekeeping events. The Journey entity is updated by business event 3. This is the business event that happens when a truck passes a gantry. The business use case responding to the event calculates and updates the Distance Traveled attribute.

And so, you work through the CRUD table. You’re looking for entities that are not read, updated, or deleted. If there is not a business explanation for this, the explanation is that you are missing a business event. If there is an entity that is read without being created, then the explanation is certainly a missing business event. By the time you have worked over the whole table, you can be certain that you have all the events and all the data.

Review

The world sometimes seems to be divided into two kinds of business analysts: those who model process and those who model data. But there is every reason why you should become an analyst who models process and data and, ideally, does it in parallel.

Data models are revealing. The stored data of a piece of business reflects its business policy. You store data because you need it to run the business, and the data is stored, read, updated, and deleted by business processes. These processes exist because of the business events that the business responds to. Data is brought into the business by the triggering data flow belonging to a business event and leaves the business on the outgoing flow of a (usually time-triggered) event.

You can look at a data model and ask what business event creates, reads, updates, or deletes this entity. Alternatively, you can look at the data attributes of data flows connected to business events and ask what entities of data these belong to.

Data entities represent the things that are important to the business. Anything that is uniquely identified or has data stored about it is important and so becomes an entity on your data model. The relationships between the entities are determined by the processing done by the business. That is, whenever a business event happens, the responding BUC will form or update a relationship. To do this, it will create and/or read the entities that it is linking.

When you come to build or buy your solution, it requires stored data to support its functionality. This probably means a database. The business data model we have been discussing here is a conceptual model. However, it shows the necessary data, and that makes it the foundation of the database design. The database designers take your conceptual model and add the technological pieces to turn it into a database design. However, database design should not influence the way in which you see the business’s stored data. Your model is of the essential data needed to support the business activities, and you are using it for requirements discovery.

Resources

Data Modeling Made Simple: A Practical Guide for Business and IT Professionals by Steve Hoberman (Technics Publications, 2009). Hoberman is an engaging writer and his take on data modeling is both straightforward and comprehensive. He shows you how to model data and, importantly, when and why you should.

Data Modeling Essentials by Graeme Simsion and Graham Witt (Morgan Kaufmann, 2004). This is the third edition of this popular book, and it takes you through the basics and theory of data modeling, discusses the stages of applied data modeling, and addresses advanced subjects including business rules.

Any of the books on UML discuss the class diagram. This is UML-speak for data models.