Table of Contents
What is a Database?
Valentina is a database, but it has some exceptional capabilities. Here is a database primer if you have very little or no experience with databases.
What You Should Already Know
You will have a conceptual understanding of the basics of computer file management – the differences between an application and a file or document.
What You Will Learn
You will have a conceptual understanding of:
- what is a database
- what is a Database Management System (DBMS)
- what are Layers of Abstraction (and why should you care?)
What is a Database
A simple definition of a database is a single unit that stores information in an organized way. This unit can be a physical file on a computer, or it can be a unit of organized information that is stored in memory.
What about Excel?
You may be thinking of how this definition can equally apply to a spreadsheet like Microsoft Excel – and you are right! In fact, there are many business people using Excel files to store information in an organized way when a database would be a much better solution for them.
What is a DBMS
A Database Management System is one or more software applications or systems created to work with databases. Every DBMS vendor has their own definition of what a DBMS is – a definition that matches the product they sell (and which often doesn’t match well the offerings of competing DBMS vendors).
What Database are you using?
For some strange reason, many computer users use the terms database and DBMS interchangeably. That is like saying Microsoft Excel and .xls files are the same thing. Just remember that DBMS is software and database is a file.
What are Layers of Abstraction (and why should I care?)
If you came into development with the intention of creating something particularly useful just for yourself and not to become a professional programmer, it`s likely that you missed out on the separation of fish from fowl.
Back in the 1970's a committee at ANSI (American National Standards Institute) didn't spend their days sitting around kidney shaped tables in turtleneck sweaters eating fondue, and instead gave serious consideration of keeping data separated and contained in a single store. ANSI recognized that individual users may need to access a single store of data, but then view that data in a special way that is customized to the needs of the user. This method of customized viewing of data was cleverly called – user views.
Back to ANSI. ANSI came up with a concrete standard for separating databases into layers of abstraction. If you keep a database separated in this way, you will reap untold riches and fame:
THE PHYSICAL LAYER
The unit we defined earlier can actually be more than one file on a hard disk. One advantage of doing this is that it is possible to segment portions of the database across multiple storage devices like hard drives. Then each file can be accessed in parallel with the others, increasing performance.
THE LOGICAL LAYER
Now we are looking within a database file itself and how information is stored there. This is also often referred to as a database schema and how the bits of data are organized across the database. To a user, a database appears as a single structure, even if it is physically separated into multiple files.
THE EXTERNAL LAYER
This is the level where users – user view live. Some external layer information can be stored within a database itself for reuse later, or it can be created on a temporary basis and then thrown away when it is no longer needed.
If you took the time to read This Thing Called the Internet, then you already have an idea what we mean by presentation, behavior and data. In the world of databases, data and some behaviors are stored inside a database. Presentation is not stored inside a database.
THIS THING CALLED THE INTERNET
When web pages first appeared on the World Wide Web, web designers happily jumbled together display rendering information with the information itself in HTML, the language of web pages. Many web designers today still do this; yet the trend is to separate information into presentation, behavior and data. Web pages and the web browsers that display them then become the user view to DBMS found on internet servers.
Microsoft and Apple More Alike Than Not
Microsoft Access is an extremely popular DBMS that, by default, stores presentation, behavior and data all within the same file. Apple Computer's FileMaker Pro is the same. However you can separate your data from presentation and behavior in Access and FileMaker Pro.
So Why Should I Care?
You might be thinking at this point – why not use an all-in-one, mix-it-up approach if it's good enough for Microsoft and Apple?
MIXING MAKES MORE WORK
So you have written an application with a million lines of code and the code is all in one convenient file. The downside is that you have to search this file to find errors as they crop up. If you store your data separately, it lets you concentrate on what is important at the time.
SIMPLIFY FOR SAFETY SAKE
Computer crashes happen. Application crashes happen. Careless programming can result in damaged applications. If the presentation part of your application is separate from your data, then a crash is less likely to impact your data.
Best Practices in Development: Multi-Tier Design
You just read about Layers of Abstraction in particular to databases, but it doesn`t apply only to databases. Multi-tier design (n-tier) means you separate your total solution into layers. For example:
Client Tier (User Interface). This is the user interface where your user views information in a meaningful way. It can be a compiled application or a web front end.
Middle Tier (or Business Logic). This is where rules are stored or, component objects are manipulated. In a web solution, this can consist of PHP or ASP templates that process various calls from the client (web browser). In application, you might have an external object (COM, .net object, XCMD, etc) that incorporates special rules.
Third Tier (or Data Services). This is where your data is stored, and likely managed by a DBMS.
If a file is constantly being written to, especially by different users, it is more vulnerable to the dangers of unprotected computing. Some files though, if damaged, can be repaired or replaced without serious loss of data that matters. For example, a database index may be rebuilt regularly to improve performance in locating data.
A Valentina database can consist of up to four physical files. If something happened to the index file, the meaningful data survives.
No Really, What about Excel?
Superficially and based on our simple definition above, Excel looks a lot like a DBMS. It is a tool for organizing data into neat rows and columns and then managing it in all sorts of imaginative ways with fancy reports, pivot tables and in-cell calculations. However Excel does not conform to many modern conventions in the world of databases – it’s a paper tiger in the face of even Microsoft Access and a soggy kitten before the data management muscle of Valentina (or Access's big brother, MS SQL Server).