SQL The Next Big Thing in SCADA
SQL The Next Big Thing in SCADA
SQL
SQL: The Next Big Thing in SCADA
800.266.7798
www.inductiveautomation.com
SQL: The Next Big Thing in SCADA
Whatever your knowledge level and feelings about are designed to handle both small and very large
SQL databases, one thing is clear: A general misun- amounts of data effectively. As a result, relational da-
derstanding and mistrust of SQL databases exists in tabases are extremely popular, so much so that they
the controls system community. There are some valid pretty much define what the word “database” means.
reasons many feel SCADA and SQL don’t go together, When you think of a database, you are more or less
but there are enormous benefits for those who over- thinking of a relational database.
come the fear of using SQL with SCADA.
The real power of a relational database comes from
its ability to search out data across multiple tables
SQL Database Basics
and relate data sets together by virtue of a shared
Before we get into the benefits of using SQL we need field type. For example, if you had three different
to cover some basics of SQL relational databases. tables that contained contact information grouped
Specifically, what relational databases and SQL are, together by social security numbers (SSN), then you
and how they relate to each other. could search all tables for the information associated
with each SSN. A relational database would return
What is a Relational Database?
all data associated with the SSN you searched,
A database is a central clearinghouse for information.
regardless of what tables or databases the informa-
It digitally stores any variety of information you can
tion was stored in.
imagine, from secure financial records, or sensitive
controls data, to information on who has late library
books. A database is not defined by what kind of
SSN # CELL HOME Relational databases
information it stores, but rather the structure in which
search for common
it stores data. 584... 916... 916...
data across multiple
Every true database requires a database manage- 592... 972... 972... tables and databases.
ment system (DBMS), and a relational DBMS is the
most widely used. A relational database is one that
stores information in the basic structure of tables SSN # MAIL WEB
made up of rows, columns, and cells. Think of it like a
584... me@... desi...
big spreadsheet, just way more flexible and powerful.
592... 3g@... phot...
Since relational databases group data into tables,
each individual data point is related to the data
around it. Structuring information in this way makes
SSN # CITY STATE
it easier to organize and retrieve data rapidly,
especially when large amounts of data are involved. 584... Sac... CA...
Relational databases are very flexible because they
592... Dal... TX...
SQL SQL
PLC
PLC PLC
PLC
Why SCADA Software Passed on SQL Traditional SCADA applications have a lot of data to
It’s difficult to say exactly why the rift between deal with and are primarily designed to display the
SCADA and SQL developed, but there are some data in real time. However, data that is not tracked
clues to why their paths never met. Around the cannot be analyzed, so SCADA software had to find
time that SQL databases where maturing, SCADA some method of storing data. In the absence of
software was also going through a transitional using SQL databases, traditional SCADA resorted to
period. One of the challenges it faced was continu- a couple of different methods of tracking time-series
ing to provide real-time data as plants grew bigger, data: PLC storage and process historians.
processes got more complex, and data became
PLC Data Storing
more and more plentiful.
One means of tracking time-series data is to store it in
Maybe SCADA software developers determined that, the PLC. This method has several problems, the most
at the time, SQL databases couldn’t handle the load important being that PLCs simply aren’t designed to
fast enough. Maybe SCADA companies didn’t want store data. The simplicity and limited storage space of
to develop software that involved the use of tech- a PLC make it a very poor location to store time-series
nology that was unfamiliar to their current custom- data. While using the PLC to store data that comes in
ers. While all of these reasons likely contributed to high-speed bursts is okay, using a PLC as a long-term
SCADA software developers ignoring SQL, the most repository for time-series data is simply not efficient;
probable explanation is simple economics: Proprie- it’s just the wrong tool for the job.
tary technologies make money while open technolo-
Process Historians
gies generally do not.
A more robust solution is the use of a process histo-
While it’s hard to pin down the exact reason why rian. A process historian is specially designed to store
SCADA software missed the boat in adopting SQL, time-series data. These historians come in all types
it is easy to see that the companies that developed and are optimized to handle large amounts of time-
SCADA software rejected SQL databases and moved series data quickly. However, there are some major
in another direction. drawbacks to using a process historian – the most
problematic being their proprietary nature.
The Wall Separating IT and Controls
Every historian is different, which means they save
The industrial automation industry deals with huge data in different formats that are often proprietary
amounts of data. Information from the plant floor is to the company that made the historian. There is
captured from PLCs (programmable logic control- no standardized language for historians, which can
ler) and passed to the SCADA system in the form of make working with them and supporting them
real-time data. Time-series data is produced as data difficult. Since historians are not standardized and
points, measured at successive time intervals; they often are structured in a proprietary format, they
typically contain a value and a time. Even simple don’t communicate well – if at all – with other data-
processes can potentially have hundreds, if not bases. The lack of easy communication effectively
thousands, of data points to follow – such as tank walls off historians from the rest of the enterprise
temperatures, scale weights, and pressure readings. system and puts them on their own data island.
Take a look at an example to see the benefits of ask- take a lot of time, resulting in a loss of production
ing questions (and being able to find the answers!). and potentially costing the company huge profits.
Let’s say a company wanted to see what the acid
If, however, the company had been properly tracking
levels of their tanks are (PLC data) based upon what
data in a SQL database that easily connected with the
raw materials vendor they used (ERP data). They also
other enterprise systems, they would have a much
wanted to see how that affected the quality of the
easier – and faster – answer. They would be able to
product (quality data) and then in turn see how all
run the above query in the database and receive the
those factors influenced the sale of the product
results in milliseconds, giving the company the answer
(ERP data).
almost instantly.
The answer to this question could reveal all kinds of
interesting and important information. The com- The New SCADA
pany could discover which tanks were producing
Simply put, data belongs in a SQL database and
higher acid levels, or that the use of raw materials
controls data is no exception to this. The speed and
from a certain vendor was resulting in poorer sales
power of modern information technologies dictate
of the product. There are any number of facts that
the speed of business, and traditional SCADA soft-
can come to light when data is questioned – facts
ware has been left behind. Doing today’s business
that can inform important decisions that affect a
with yesterday’s technology just doesn’t make sense
company’s bottom line. Having controls data easily
in the modern fast-paced manufacturing industry.
accessible in a SQL database makes questions like
this possible to ask, and easy to answer. The power of SQL databases is changing the defini-
tion of what a SCADA system can and should be.
SQL Results in Huge Time Savings
SCADA systems that take full advantage of SQL
In business time is money, and having con-
databases have flexibility, power and speed that tradi-
trols data in a SQL database can save a large
tional SCADA can’t offer. Companies that embrace the
amount of time. To illustrate this, let’s take
use of SQL with their SCADA systems stand to gain a
a look at some simple questions and how long it
huge advantage over their competition.
might take to answer them.
Continuing from the previous example, let’s say
the company has a recall on some of their product
because it was discovered to have high acid levels.
Now they could recall their entire production, result-
ing in huge losses, or they could narrow down the
cause of the problem and identify which product
shipments were actually affected. To do this they
would need to find the acid levels in all their tanks,
and cross reference that with the product batches
they produced, along with what shipment resulted
from those batches and where they went.
If this company did not track controls data at all, it
SQL
would simply be out of luck. If they did track it but
could only keep it on spreadsheets, the company
would be forced to manually go through all of their
data to try to find the answer they needed. Depend-
ing on the size of the data set, this could take hours,
days, or even weeks.
If another variable was entered into the equation, the
search would have to begin all over again. This would