Lecture 1.2.3

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Data modeling approaches

Data modeling can be a painstaking upfront process and, as such, is


sometimes seen as being at odds with rapid development methodologies.
As Agile programming has come into wider use to speed development
projects, after-the-fact methods of data modeling are being adapted in
some instances. Typically, a data model can be thought of as
a flowchart that illustrates the relationships among data. It enables
stakeholders to identify errors and make changes before any
programming code has been written. Alternatively, models can be
introduced as part of reverse engineering efforts that extract models
from existing systems, as seen with NoSQL data.
Data modelers often use multiple models to view the same data and
ensure that all processes, entities, relationships and data flows have been
identified. They initiate new projects by gathering requirements from
business stakeholders. Data modeling stages roughly break down into
creation of logical data models that show specific attributes, entities and
relationships among entities and the physical data model.
The logical data model serves as the basis for creation of a physical data
model, which is specific to the application and database to be
implemented. A data model can become the basis for building a more
detailed data schema.
Steps of Data Modeling
 Step 1: Understand your application workflow
 Step 2: Model the queries required by the application
 Step 3: Design the tables
 Step 4: Determine primary keys
 Step 5: Use the right data types effectively
Three Data Modeling Best Practices
1. Spread data evenly around the cluster. For Cassandra to work
optimally, data should be spread as evenly as possible across
cluster nodes which is dependent on selecting a good partition key.
2. Minimize the number of partitions to read. When Cassandra
reads data, it's best to read from as few partitions as possible to
avoid impacting performance.
3. Anticipate how data and requirements will grow. For example,
would you design the data model differently if you had 100 versus
millions of transactions per user?
DATA MODELING STEPS
Because there’s ample data to cater to, data modeling happens step-wise.
Let’s take a look at the steps of data modeling.

IDENTIFY ENTITIES
We first consider raw data into different sets, each modeled separately.
Each set has some business objects or entities. The first step is to
identify these entities.

IDENTIFY A KEY PROPERTY


Every entity has a key property. This way, you can differentiate between
entities in a data model. For instance, in an employee data model,
employee ID is a unique property.
CREATE A ROUGH DRAFT
Entities in a data set form a connection with each other in some way or
another. Make a rough draft to display how the entities connect with
each other.

IDENTIFY DIFFERENT DATA ATTRIBUTES


After creating a rough draft, identify different data attributes or
properties. Incorporate these attributes into the data model.

MAP OUT THE ATTRIBUTES


Map the attributes to entities after identifying various attributes. This
way, the Entity-Relationship model will show what the data means from
a business point of view. For instance, let’s consider the employee data
model we discussed earlier. There, the employee’s name, ID, and join
date are different attributes that we can map to the employee table.

All clear about the what, why, and how? Then let’s discuss some pros
and cons of using a data model.

PROS
LOWER COSTS
Data models help in lowering the cost of development. Generally,
companies spend a lot of funds on coding and testing. Data modeling
reduces the company’s coding budget. Not only that, the best part is that
data models don’t use a lot from the budget. A data model also catches
errors at an earlier stage. Don’t you think that’s a lot better than
correcting mistakes when coding is complete? Or worse, imagine if the
customers use your app only to find unfixed errors! How would that
affect your business’s reputation?
BETTER MANAGEMENT OF DATA AS A RESOURCE
You can normalize your data with data modeling. You can also define
the data in terms of what it is. Not only that, you can even define data in
terms of the properties it can have. Querying the database and generating
reports are important processes of any business. Data modeling provides
the tools for the same. As a result, you can manage the data as a resource
in a better way. Just think of it this way—suppose you hire a developer
to create your database. What will the developer find easier: developing
from an Excel sheet with multiple entities, or from a diagram that
explains how all the entities connect with each other?
ACCURATE REPRESENTATION OF OBJECTS
Data modeling provides an accurate description of data objects by
creating a flow or diagram. This diagram shows how the entities and
their properties connect with each other or with other elements in the
database. You can use the information to define the relationship between
tables, primary, and foreign keys.
BETTER PERFORMANCE
Most people think that a database runs slow because of some problem in
the database design. But in reality, without a data model, the database
development is poor. Also, data modeling ensures better performance by
easing the database tuning. When the concepts in a data model are clear,
the developer can design a database that runs faster.
CONS
Like all other new technologies, with so many pros, there’s bound to be
some cons as well.
 You can’t perform data modeling without knowing the features of
the physical data stored.
 Even if you make only a minor change in the structure later, you’ll
need to modify the entire structure.

Functional Modeling
In the Functional Model, software converts information. and to
accomplish this, it must perform at least three common tasks- input,
processing and output. When functional models of an application are
created, the software engineer emphasizes problem specific tasks. The
functional model begins with a single reference level model (i.e., be
manufactured). In a series of iterations, more and more functional detail
is given, until all system functionality is fully represented.
Information is converted because it flows from a computer-based
system. The system takes input in various forms; Hardware, software,
and human elements are applied to replace it; And produces in various
forms. The transformation (s) or function may be composed of a single
logical comparison, a complex numerical method, or a rule- the
invention approach of an expert system. The output can light an LED or
provide a 200 page report. Instead, we can create a model or flow model
for any computer- based system, regardless of size and complexity.
Structural analysis started as an Information Flow Modeling technique.
A computer-based system can be modeled as an information transform
function as shown in figure.
A rectangle represents an external unit. That is, a system element, such
as a hardware, a person or another system that provides information for
transformation by the software or receives information provided by the
software. A circle is used to represent a process or transform or a
function that is applied to data and changes it in some way. An arrow is
used to represent one or more data items.

All arrows should be labeled in a DFD. The double line is used to


represent data store. There may be implicit procedure or sequence in the
diagram but explicit logical details are generally delayed until software
design.
Behavioral Modeling
Behavioral model describes the interaction in the system. It represents
the interaction among the structural diagrams. Behavioral modeling
shows the dynamic nature of the system. They consist of the following −
 Activity diagrams
 Interaction diagrams
 Use case diagrams
Behavioral modeling means using available and relevant consumer and
business spending data to estimate future behavior. Behavioral modeling
is used by financial institutions to estimate the risk associated with
providing funds to an individual or business but is also used in
marketing, advertising, and sales forecasting. A new area of economics,
called behavioral economics, also relies heavily on behavioral modeling
to predict behaviors of agents that fall outside of what would be
considered entirely fact-based or rational behavior.

Breaking down Behavioral Modeling


Financial institutions, such as banks and credit card companies, use
behavioral modeling to estimate how individuals are likely to use their
services. For example, a credit card company will examine the types of
businesses that a card is normally used at, the location of stores, and the
frequency and amount of each purchase to estimate both future purchase
behavior and whether a cardholder is likely to run
into repayment problems.

Example of Behavioral Modeling


For example, a credit card company may notice that a cardholder has
shifted from making purchases at discount stores to high-end stores over
the last six months. By itself, this may indicate that the cardholder has
seen an increase in income, or could mean that the cardholder is
spending more than he or she can afford. To narrow down the options
and create a more accurate risk profile, the card company will also look
at other data points, such as whether the cardholder is only paying
the minimum payment or if the cardholder has made late payments. Late
payments may be an indicator that the cardholder is at a greater risk
of insolvency.

Behavioral modeling is also used by retailers to make estimates about


consumer purchases. A retailer could, for example, examine the types of
products that a consumer purchases in-store or online and then estimate
the likelihood that the consumer will purchase a new product based on
how similar it is to their previous purchases. This is especially useful to
retailers who provide customer loyalty programs, which allow them to
track individual spending patterns with more granularity. For example, if
a store determines that consumers that purchase shampoo will also
purchase soap if provided a coupon, the store may provide a coupon for
soap at a point-of-sale terminal to a consumer who only purchases
shampoo.

You might also like