The Database is an essential part of our life. As we encounter several activities that involve our interaction with databases, for example in the bank, in the railway station, in school, in a grocery store, etc. These are the instances where we need to store a large amount of data in one place and fetch these data easily.
A database is a collection of data that is organized, which is also called structured data. It can be accessed or stored in a computer system. It can be managed through a Database Management System (DBMS), a software used to manage data. Database refers to related data in a structured form.
A database is a persistent, logically coherent collection of inherently meaningful data, relevant to some aspects of the real world.
Types of Databases:
- Hierarchical databases
- Network databases
- Object-oriented databases
- Relational databases
- NoSQL databases
SQL Databases | NoSQL Databases | |
---|---|---|
Data Storage Model | Tables with fixed rows and columns | Document: JSON documents, Key-value: key-value pairs, Wide-column: tables with rows and dynamic columns, Graph: nodes and edges |
Development History | Developed in the 1970s with a focus on reducing data duplication | Developed in the late 2000s with a focus on scaling and allowing for rapid application change driven by agile and DevOps practices. |
Examples | Oracle, MySQL, Microsoft SQL Server, and PostgreSQL | Document: MongoDB and CouchDB, Key-value: Redis and DynamoDB, Wide-column: Cassandra and HBase, Graph: Neo4j and Amazon Neptune |
Primary Purpose | General purpose | Document: general purpose, Key-value: large amounts of data with simple lookup queries, Wide-column: large amounts of data with predictable query patterns, Graph: analyzing and traversing relationships between connected data |
Schemas | Rigid | Flexible |
Scaling | Vertical (scale-up with a larger server) | Horizontal (scale-out across commodity servers) |
Multi-Record ACID Transactions | Supported | Most do not support multi-record ACID transactions. However, some—like MongoDB—do. |
Joins | Typically required | Typically not required |
Data to Object Mapping | Requires ORM (object-relational mapping) | Many do not require ORMs. MongoDB documents map directly to data structures in most popular programming languages. |
Ubuntu >> digitalocean.com
Mac >> Watch on youtube
$ python -m pip install pymongo
https://pymongo.readthedocs.io/en/stable/
https://www.mongodb.com/try/download/compass
learn SQLite from here
Sources: