Alt Database, SQL and NoSQL
Database, SQL and NoSQL

Alpha Beta - Database is a collection of information that is compiled so that it can be easily accessible, managed, and updated. Database usually contains a record aggregation or data file, which contains information. Database is an abstraction of the operating system file system that makes it easy for developers to build applications that make, read, update, and delete persistent data.


The database makes structured storage can be relied upon and fast. They also give you a framework for how data must be stored and taken over -Salih must find out what to do with the data every time you create a new application.


Relational database


This stores data in a series of tables. The interconnection between tables is known as a foreign key. Each table has at least one category of data in the column, and each row has a certain data instance for the category defined in the column.


Structured query (SQL) is a user program interface and standard application for relational databases. SQLite, a database included with Python, creates one file for all data per database. Other databases such as PostgreSQL, MySQL, Oracle and Microsoft SQL Server have more sophisticated features that are useful for storing web application data.


Python standard for database interfaces is Python DB-API. DB-API provides a minimum standard for working with a database using python structure and syntax as much as possible. This fire is among the following -


  • Import the fire module.

  • Get a connection with a database.

  • Issue SQL statements and stored procedures.

  • Close the connection


SQL database


SQL means structured queries. In SQL we can produce queries to take or update the database. SQL is a standard language for a relational database system. This allows you to make a relationship between tables, can be one on one, one to many, many comparison, many people. This is an example of a relational database management system.


All relational database management systems (RDM) such as MySQL, MS Access, Oracle, Sybase, Informix, Postgres and SQL Server use SQL as their standard database language.


Using SQL Python library to connect to the database


To interact with any database through SQL Python library, we must be connected to the database. We have to install the SQL Python driver for MySQL to interact with the MySQL database from the Python application.


The MySQL database has a two -step process for creating a database:


  1. Make a connection to the MySQL server.
  2. Run a separate query to create a database.

The database is not yet created. To do this, We’ll define another function create_database() that accepts two parameters :

connection is the connection object to the database server that you want to interact with.

query is the query that creates the database.
NoSQL Databases
NoSQL expands to “Not Only SQL”. It lends us a way to store and retrieve data that we can model in forms other than relational (tables). NoSQL databases largely find use in applications involving large data and real-time uses. 


The reason we call them “Not Only SQL” is because they may support query languages that are SQL-like. We can use NoSQL to store data in forms like key-value, document, columnar, and graph. When working with large sets of distributed data, we use NoSQL.

Examples- MongoDB, redis, Apache HBase , cassandra, etc.

We have four different types of data we can model with NoSQL Database in Python-


a. Document Databases


Alt Database, SQL and NoSQL



In a document database, each key pairs with a document. Documents are the main concept in document databases. The database stores and retrieves documents, which can be XML, JSON, BSON, and so on. These documents are self-describing, hierarchical tree data structures which can consist of maps, collections, and scalar values. A document is a complex data structure and can hold any of the following- key-value pairs, key-array pairs, nested documents.


b. Graph Stores


Alt Database, SQL and NoSQL



A graph store holds knowledge about data networks. One such network is social connections. In a graph store, a node is like a record in a relational database, and an edge is like a connection between nodes. Graph databases are very well suited to problem spaces where we have connected data, such as social networks, spatial data, routing information for goods and money, recommendation engines. We use these for applications like CRM and reservation systems. Some examples are Neo4J and Giraph.


c. Key-Value Stores

Alt Database, SQL and NoSQL


A key-value store holds key-value pairs in its structure. Key-value pair data stores are based on hash map data structures. Key-value stores are the simplest NoSQL data stores to use from an API perspective. We use these in applications like session management and caching in web applications. Some examples include Riak, Redis, and Berkeley DB.


d. Wide-Column Stores


Alt Database, SQL and NoSQL


When we want to store columns together working with queries over large datasets, we can use wide-column stores. Column-family databases store data in column families as rows that have many columns associated with a row key. We also find these in SQL databases and they query large volumes faster.


Post a Comment

Lebih baru Lebih lama