MongoDB

MongoDB Introduction NoSQL databases are non-relational databases that are used to store and retrieve data. MongoDB is a popular NoSQL database that is used to store data in the form of documents. Feature SQL (Relational Databases) NoSQL (Non-Relational Databases) Schema Fixed schema Dynamic schema for unstructured data Scalability Vertical scalability (scale-up by adding more powerful CPU, RAM, SSD) Horizontal scalability (scale-out by adding more servers) Complexity Tables with rows and columns, complex queries with JOINs Document, key-value, wide-column, or graph formats, simpler queries Transactions ACID properties (Atomicity, Consistency, Isolation, Durability) for reliable transactions BASE properties (Basically Available, Soft state, Eventual consistency) less strict than ACID Development Model Mature, with established standards More flexible and evolving rapidly Use Cases Well-suited for complex queries and transactions, e.g., banking systems Well-suited for hierarchical data storage, big data solutions, and real-time web applications Data Integrity High, due to ACID compliance Variable, depending on the specific NoSQL system and its configuration Query Language Structured Query Language (SQL) is standardized No standard; queries are based on the specific NoSQL database system (e.g., MongoDB uses BSON) Relationship Handling Efficient handling of relationships between entities Relationships can be handled, but often less efficiently than SQL databases; denormalization is commonly practiced Installation There are two ways of working with a mongoDB database, one is to run it locally on your machine and the other is to use a cloud service like MongoDB Atlas. For this tutorial, we will be using MongoDB with mongosh and compass installed. ...

June 27, 2024 · 4 min · 709 words · Aum Pauskar

Extended markdown cheatsheet with KaTeX

Extended Markdown Cheatsheet Heading 1 2 3 4 5 6 # Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6 Paragraph 1 This is a paragraph. Code snippet 1 'print("Hello World")' block of code 1 2 3 ''' print("Hello World") ''' code within the clock of code can be selectively highlighted 1 2 3 '''python print("Hello World") ''' Emphasis 1 2 3 4 5 *This text will be italic* _This will also be italic_ **This text will be bold** __This will also be bold__ _You **can** combine them_ Table 1 2 3 4 | Syntax | Description | | ----------- | ----------- | | Header | Title | | Paragraph | Text | Bulletpoints 1 2 3 4 - Bulletpoint 1 - Bulletpoint 2 - Bulletpoint 2.1 - Bulletpoint 2.2 or ...

November 25, 2023 · 2 min · 287 words · Aum Pauskar

Git and GitHub cheatsheet

Git / github cheatsheet Installation of git Download git from here or use on debian based linux 1 2 sudo apt update sudo apt install git Check if git is installed 1 git --version Configure git 1 2 git config --global user.name "Your Name" git config --global user.email "Your email" (Optional) Change the default brach name from master to main 1 git config --global init.defaultBranch main Configuring SSH keys to github Run these commands on the terminal 1 2 3 4 ssh-keygen -t ed25519 -C "$Your email" eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 cat ~/.ssh/id_ed25519.pub Go to Github>Settings>SSH and GPG keys. Click on New SSH key. Give a title and paste the key in the key field. Click on Add SSH key. The key should be available from the last command on the terminal. Git commands git init - initialize a git repository git add <file> - add a file to the staging area git add . - add all files to the staging area git add -A - add all files to the staging area git commit -m "message" - commit changes to the local repository git push - push changes to the remote repository git push -u origin <branch_name> - push changes to a branch git push origin <branch_name> - push changes to a branch git pull - pull changes from the remote repository git pull origin <branch_name> - pull changes from a branch git status - check the status of the repository git log - view the commit history git branch - view the branches git branch <branch_name> - create a new branch git checkout <branch_name> - switch to a branch git checkout -b <branch_name> - create and switch to a branch git merge <branch_name> - merge a branch into the current branch git clone <url> - clone a remote repository git remote add origin <url> - add a remote repository git remote -v - view the remote repositories git remote set-url origin <url> - change the url of the remote repository git remote remove origin - remove the remote repository git submodule: git submodule is used to add a git repository inside another git repository. This is useful when you want to use a git repository inside another git repository. For example, you can use git submodule to add a git repository that contains a library to your project. This way, you can use the library in your project without having to copy the library files into your project directory. git submodule add <url> - add a submodule git submodule init - initialize the submodule git submodule update - update the submodule git submodule update --remote - update the submodule to the latest commit

November 25, 2023 · 3 min · 447 words · Aum Pauskar

Database management and SQL

Sql documentation Installation The installation and usage of MySQL can be done in many ways; one is to install WAMP/XAMPP server and using SQL through it another is to use an online sql emulator, the best way is to use a MySQL server. Getting started with MySQL All the operations in SQL can be classified into 3 types DDL: Data definition language includes operation like create, alter, drop DML: Data manipulation language includes operation like select, insert, update, delete DCL: Data control language includes operations like commit, rollback, grant, revoke ...

November 16, 2023 · 10 min · 1996 words · Aum Pauskar