What is a database? #
A database is a repository on a computer where data, information, documents and images are stored electronically in an organised or systematic structure so that it can be rapidly accessed, edited, managed and used.
This is controlled by a database management system (DBMS) which enables the extraction and management of the data following a query or request from another application or system.
Most databases and DBMS’ use SQL (structured query language) as a programming language for storing, retrieving and manipulating data – especially relational databases.
Types of database #
The original databases, first introduced back in the 1960s, consisted of three fairly basic navigational systems – flat databases, hierarchical databases and network databases – that were arranged alphabetically, chronologically or numerically.
Since then, databases have evolved significantly. The 1980s saw the introduction of relational databases, a structure that is still widely-used today, and the 1990s delivered object-oriented databases. More recently, NoSQL databases, cloud databases and self-driving databases, have been developed in response to the growing demands and rise in use of the internet and cloud technology.
Which type of database is right for an organisation will be determined by how the organisation wants to access and use the data contained within.
Hierarchical databases #
Hierarchical databases, as the name suggests, are organised by hierarchy, similar to a family tree, in which each set of records branches off into smaller sub record sets. Hierarchical databases provide a one-to-many relationship, which means just one record in a table can be linked with one or more records at different levels and in other tables.
Network databases #
Network databases, on the other hand, allow multiple links and relationships between multiple records. A record can therefore have multiple parent and multiple child records, a slight improvement to that of hierarchical databases.
Flat databases #
A flat database is used to store unstructured data in plain text format – a flat file. Individual lines of the text file hold one record with additional data fields separated by delimiters. These delimiters can be commas or tabs to help you define a structured format.
A flat file is often used when importing data between databases, such as importing a product catalogue or customer contact list. Most database programs can import flat file databases.
An example of a flat file is the creation of a spreadsheet that includes a list of products, customers, vendors or suppliers with details such as company name, contact person, contact address and telephone number. The spreadsheet is easy to sort, view and extract, as and when required, and often saved as a CSV file.
Relational databases #
Relational databases are still the most widely-used model within many organisations, due to their simplicity, data accuracy and integrity, and due to the fact that the majority of ERP systems are built on them.
A relational database organises data into rows and columns, to collectively form a table – similar to a spreadsheet. A database management system (DBMS) then enables users to input, arrange, edit, delete or select these data fields, records and tables in the database.
Relational databases are often used by multiple users within an organisation where employees need to access data to make changes, or increased data visibility is required throughout the business to aid decision making.
Popular relational database examples include:
Object-oriented databases #
Object-oriented databases (OODB) are often used by big data organisations, such as engineering companies and science laboratories, as they can manage much more complex collections of data.
Object-oriented databases store and represent data in the form of objects and classes. Following the principal of object-oriented programming (OOP), an object represents an entity and a class is a collection of objects.
An object contains a data set and all of its attributes meaning that all the information is contained and available in the one package. Each object has standard properties but also includes behaviour, which details the activities it can perform
The objects are recognised by a unique identifier and organised into hierarchical classes. An object may inherit properties from higher-level classes or be connected to them. A query language can then be used by a DBMS to retrieve the information stored.
Object-oriented database examples include:
- InterSystems IRIS
- ObjectDatabase++
- ObjectStore
- GemStone/S
- ObjectDB
- Perst
- ZODB
NoSQL databases #
NoSQL databases, also known as nonrelational databases, are mainly adopted for their speed and scalability due to using unstructured and semi-structured data – making them ideal for websites and web applications.
NoSQL databases store data in documents, often JSON, rather than the tabular, relational tables, records and fields found in relational databases. All information is stored as an attribute in this document.
NoSQL actually stands for ‘not only SQL’ meaning that it can work with both JSON and SQL – it’s not limited to just documented-oriented data management.
To further expand their flexibility, there are a variety of different types of NoSQL databases available. These include:
- Document – stores and queries data as JSON-like documents, or XML.
- Key-value – stores data as a set of unique identifiers, each of which have an associated value.
- Graph – uses graph structures to define the relationships between stored data points.
- In-memory – stores data in a computer’s main memory instead of a disk drive to produce quicker response times.
- Wide-column – stores large amounts of data in flexible columns that can be spread across multiple servers.
Some of the most popular NoSQL database examples include:
- Couchbase – document-oriented database that combines NoSQL and SQL
- MongoDB – open source document-oriented database
- Amazon DynamoDB – a key-value and document-oriented database
- Cassandra – open source wide-column database
- RavenDB – document-oriented database
- Redis – open source in-memory database
Distributed databases #
Distributed databases are often used within organisations that have numerous offices, shops or syndicated sites in different locations around the world, such as hotel chains, retailers etc.
A distributed database basically means that the data is stored across multiple servers, networks and locations, although appears to users and applications as a single database. This is controlled by a centralised DBMS that integrates the data logically, making it possible to manage the data as if it was stored in the same location.
Many NoSQL databases listed above are in fact distributed databases, such as Cassandra, Couchbase and FoundationDB, and are becoming increasingly popular thanks to their scalability, consistency, resiliency and geo-replication. Hence, they have been widely adopted by global corporations, such as Netflix, eBay and Uber.
Cloud databases #
Cloud database, as the name suggests, are run on a cloud computing platform, whether private, public or hybrid, providing either traditional access to the data or as-a-service (DBaaS).
Most types of database can be supported on a cloud platform, relational or NoSQL, enabling enterprise users to host databases without buying dedicated hardware.
With a traditional deployment model, an organisation simply rents virtual machine space from a cloud services provider and the database is hosted in the cloud. The organisation then uses its own internal IT team to run and manage the database.
Database as a service, on the other hand, means that the cloud provider manages the entire database environment for a subscription fee.
This is especially useful for start-ups or companies launching applications that need to go to market extremely quickly. Upfront costs are removed, risk is reduced and it provides a great deal more agility and flexibility.
The most popular cloud databases are:
Autonomous databases #
The latest type of database is an autonomous or self-driving database. These are also cloud-based, but use machine learning to automate traditional database tasks, such as updates, backups, security and optimisation, that IT administrators would usually perform.
What is a database management system? #
A database management system (DBMS) is a dedicated piece of software that provides the interface between a database and the end users or applications that need access to the stored data.
A DBMS basically provides users and applications with access and control over their data. It organises database files and provides users with the ability manage how the data is organised and optimised in the database, including creating, editing, and updating it when needed.
The database management system then provides the ability to store, query and retrieve data when required.
Queries are the main way users retrieve database information, and the DBMS facilitates this by providing a centralised view of data, having defined the relationships between the various tables, objects or indexes.
This is achieved via APIs (application program interfaces), which handle the requests and responses for specific types of data over the internet.
The majority of databases use SQL (structured query language) to achieve this, although as we have explained above, there is a proliferation of newer databases that are taking a different approach.
Common database management systems include:
What is MySQL? #
MySQL became the platform of choice for web developers and web-based applications. Because it’s designed to process millions of queries and thousands of transactions, MySQL is a popular choice for eCommerce businesses that need to manage multiple money transfers. On-demand flexibility is the primary feature of MySQL.
MySQL is the DBMS behind some of the top websites and web-based applications in the world, including Airbnb, LinkedIn, Facebook, Twitter and YouTube.