Skip to content

Instantly share code, notes, and snippets.

View DGamer007's full-sized avatar
🏠
Working from home

Dhruv Prajapati DGamer007

🏠
Working from home
View GitHub Profile
@DGamer007
DGamer007 / SSH.md
Last active October 2, 2023 13:31
Introduction to SSH (Secure Shell) for remote access. Learn how to set up SSH on Linux and Windows, generate SSH key pairs, and establish secure connections between client and server machines. Includes step-by-step instructions and helpful tips.

What is SSH ?

SSH (Secure Shell) is a cryptographic network protocol used to secure data communication over an unsecured network. It provides secure and encrypted connections for remote login, remote file transfers, and other network services between two untrusted hosts over an insecure network. SSH is widely used for managing network devices, remote administration, and for securely transmitting data. It utilizes a client-server paradigm, in which clients and servers communicate via a secure channel.

How to use SSH Protocol for Remote Access ?

In an SSH setup, one machine acts as the Server and the other machine acts as the Client. The client machine makes a request to the server machine and establishes a secure connection over which it can securely access the server's resources. The server machine listens for incoming requests from clients and provides the requested resources.

Step-1: Check if SSH-Client is Installed on Client machine. Just type ssh in Terminal and if you get some Outp

@DGamer007
DGamer007 / MongoDB Replication and Sharding.md
Last active October 2, 2023 13:34
Explore MongoDB Replication and Sharding in-depth. Learn how to ensure data availability and scale your MongoDB database for optimal performance.

MongoDB Replication and Sharding

2 Major Problems with Database Servers

  • What if Server shuts down (Data Availability Problem)
  • What if the Server is Incapable of Handling Request or Data (Scaling Problem)

Data Availability Problem

In MongoDB, Servers are basically mongod Processes. Let's say we have only one Server and it shuts down. Now, If we had two servers running from the start, one as a Primary Server and another as a Backup Server then once the Primary Server fails, we can serve up the content from Backup Server. To keep both of them in-sync, We need to keep track of all CUD(Create-Update-Delete) operations performed on Primary Server and replicate them on Backup Server as well.