DEV Community

Emon Islam
Emon Islam

Posted on

Back-end seven things that the server-side uses every day

1.node.js

Node Js in 2009. Node lets developers write JavaScript code that runs directly on the computer process instead of the browser. So the node can be used to write server-side applications, including access to operating systems, file systems, and everything needed to create fully-functional applications.
NodeJS is a cross-platform and open-source JavaScript runtime environment.
Nodejs allows JavaScript code to run outside the browser. Nodejs comes with many modules and is mostly used in web development. Node js allows server-side javascript code to run.
JavaScript is a scripting language concept of Oops, but it is based on prototype inheritance. Javascript is an updated version is ECMA Script. Javascript high-level programing language in dynamic.

2. Express.js

Express is a minimal and flexible Node.js web application framework that provides a powerful set of features for web and mobile applications. API is an innumerable companion Express is now, and for many years, the node de-facto library. Js ecosystem. When you are looking for a tutorial on node learning, Express is presented and people are taught. In a recent State of JS survey, Express was in the top 1 for all categories.

3. CRUD Operations

The server communicates to database crud operations Create, read, update and delete operations that can be performed with most traditional database systems.

example: database create

app.post('/user',async(req,res) =>{
    const user = req.body.user;
    const result = await usersCollection.insertOne(user)
    res.json(result);
})

Enter fullscreen mode Exit fullscreen mode

example: database read

app.get('/user',async(req,res) =>{
    const result = await usersCollection.find({}).toArray();
    res.json(result);
})
Enter fullscreen mode Exit fullscreen mode

example: database update

app.put('/user',async(req,res) =>{
    const user = req.body.user;
    const result = await usersCollection.updateOne(user)
    res.json(result);
})

Enter fullscreen mode Exit fullscreen mode

example: database delete

app.delete('/user',async(req,res) =>{
    const user = req.body.user;
    const result = await usersCollection.deleteOne(user)
    res.json(result);
})
Enter fullscreen mode Exit fullscreen mode

4. JWT

JWT means JSON Web Token representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is digitally signed using JSON Web Signature (JWS) and encrypted using JSON Web Encryption (JWE) JSON secret web object hide in encrypted and server-side verified to access legal information getting and confirmed.

5. Mongoose

Mongoose is a JavaScript framework that is commonly used in a Node. Js application with a MongoDB database. Mongoose is an Object Data Modeling (ODM) library And nodes. JS manages data relationships, provides schema validation, and translates between objects in the code and presents those objects in MongoDB is an open-source NoSQL database management program. It is a MongoDB approach to meet the demands of data growth NoSQL document JSON database is horizontally scalable. Document to a significantly faster MongoDB Database

NoSQL Database

  • NoSQL database is horizontally scalable.
  • NoSQL databases are document, key-value, graph, or wide-column stores.
  • NoSQL Document type JSON.

6. Relational database (MySql)

MySql is an open-source relational database management system (RDBMS). A relational database organizes data into one or more data tables where data types can be related to each other. These relationships help in structuring the data.
SQL Database

  • SQL database is vertically scalable.
  • SQL databases are table-based.
  • multi-row transactions.

7. Aggregation

The aggregate () function of Mongoose is how you use the integration framework of MongoDB with Mongoose. Mongoose's aggregate () is a thin wrapper, so any query that works on the MongoDB shell should work on Mongoose without any changes.
MongoDB driver in node js find, an insert, get, post, operation query aggregation.

await Character.create([
  { name: 'Ruman', age: 55, rank: 'Ceo'},
  { name: 'Sumon', age: 32, rank: 'Marketer' },
  { name: 'Rahim', age: 23, rank: 'Designer' },
  { name: 'Sabbir', age: 25, rank: 'Full-stack Developer' },
  { name: 'Ashik, age: 24, rank: 'Back-end Developer' }
]);

const filter = { age: { $gte: 23 } };
let docs = await Character.aggregate([
  { $match: filter }
]);

docs.length; // 1
docs[0].name; 
docs[0].age 

// `$match` is similar to `find()`
docs = await Character.find(filter);
docs.length; // 1
docs[0].name;
docs[0].age 

Enter fullscreen mode Exit fullscreen mode

Top comments (0)