If you have ever dealt with Microsoft excel to create a table and store data then it is very easy for you to understand what a database is, a database is a place where we store data but how is this data stored, its stored in the form of tables, its like what an Excel has i.e. Rows and Columns.
So now the question comes then why not use Excel as a database instead of purchasing an enterprise database, the answer is simple, excel or a spreadsheet has limitations on the number of Rows which it can contain i.e. a database can store billions and trillions of records (individual rows) and perform processing (Reading/writing) on the same, also a database has a lot of additional functions for data manipulation which cannot be performed in excel
These databases can be used by applications to connect and store data, it’s the same applications which we just read about in the previous section
I have taken an example which I have explained in the diagram, lets see the combination of application Query and database Read in action
So, in this example of Netbanking a user logs in into the Netbanking application and checks his account balance, the application server has that logic programmed in it using which it runs a Query on the database to fetch the results from 2 tables "Customer ID from the customer master then using that same Cust ID it fetches the balance from the Balance table". Please be mindful of the fact that the application and the database are hosted on 2 different servers and internet banking also has Web servers which is not shown in the diagram to avoid complexity
So, in a Nutshell a database is a system which stores information which can be managed and processed accordingly as per the business requirement. Every Enterprise has huge amounts of data stored in their databases which daily gets updated and processed, each database is made up of multiple tables and these tables can be linked or referenced to make a call from one table to another, this is also one of the reason why we call such type of databases as Relational databases as there is a relationship amongst the tables.
The software which is used to manage these databases is called RDBMS "Relational Database Management System"
The most popular RDBMS systems in the Industry are:
• Oracle
• Microsoft SQL
• MySQL
Till now whatever I talked about was all with regards to structured information such as rows and columns where there is a fixed Schema which is being used for storing information, I guess I just threw some jargons here, Ok in very simple words structured data or information means that the data is stored in "Rows and columns" and can be searched / filtered / updated / deleted very easily and the Name of the columns are usually fixed and can be called as a schema which means that all data which is coming into this table will go into the same columns in the same format, for e.g. a banking customer database table can have column names as:
• First Name
• Last Name
• Customer ID
• Age
• Type of Account
• Phone Number
• Etc, etc
All the above columns would be fixed always and may not change, these column names together is called as a Schema
RDBMS databases are used for storing financial information and transactions
Well till now I guess you have a clear idea what a database is, here I would like to take the opportunity to introduce the concept of NoSQL databases. NoSQL databases store data in the form of Objects and Key value pairs which means they don’t have a fixed schema, first let me show you how an Object may look like:
Yes, you may be thinking that it’s the same thing which was described before for RDBMS but this information is not stored in any table and these fields are not fixed, instead of a Row this information is stored in a similar way as its shown above and for every object there can be "additional fields" or less fields which means that the Schema is not fixed or as we call it in the IT world its "Schema-Less". As its Schema Less the NoSql databases are perfect for storing unstructured information, so taking the same example of Netbanking if we look at the diagram of a NoSQL DB then it may look something like this:
I have taken an example of NoSQL DB using Key-Pairs but it can also be a document or graph based database
If you look at the NoSQL diagram and compare it with the RDBMS example you would realize that instead of Querying at 2 places (tables) referencing one from the other, in the NoSQL case all the information is stored in a single Object and directly retrieved from a single Object
Do remember all these databases are deployed in HA in an Enterprise i.e. they are deployed in clusters or groups for redundancy, the most popular RDBMS is Oracle which supports Oracle RAC which is an Active-Active Cluster where a group of servers can actively read and write from a database simultaneously.
Microsoft also provides different types of HA features in SQL but they are all mostly Active-Passive and doesn’t have a true Active-Active Architecture till date
As for the NoSQL database, they are all Active passive which means there can only be a single primary server where you can perform your "Writes" and rest of the servers in the cluster can only help in performing "Reads"
Although I have given an example of Netbanking for explaining NoSQL database but do remember applications like Netbanking / Core banking would always use RDBMS style databases as the schema is always fixed