0% found this document useful (0 votes)
10 views30 pages

Full Stack

Virtualization creates virtual versions of physical components, enabling multiple virtual machines to share a single hardware resource, while cloud computing delivers computing services over the internet based on virtualization. The document outlines the differences between virtualization and cloud computing, highlighting that virtualization maximizes hardware use and provides better control, whereas cloud computing offers scalable services. Additionally, it discusses MongoDB's integration with Node.js, NPM's features, and basic MongoDB shell queries.

Uploaded by

siva1prakash1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
10 views30 pages

Full Stack

Virtualization creates virtual versions of physical components, enabling multiple virtual machines to share a single hardware resource, while cloud computing delivers computing services over the internet based on virtualization. The document outlines the differences between virtualization and cloud computing, highlighting that virtualization maximizes hardware use and provides better control, whereas cloud computing offers scalable services. Additionally, it discusses MongoDB's integration with Node.js, NPM's features, and basic MongoDB shell queries.

Uploaded by

siva1prakash1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
2. What is Virtualization? e Virtualization is the process of creating virtual versions of physical components. e A Hypervisor (Virtual Machine Monitor) enables virtualization by allowing multiple virtual machines (VMs) to share a single physical hardware resource. © Types: ° Server Virtualization ° Storage Virtualization ° Network Virtualization ° Desktop Virtualization Example: A single server can run multiple OS instances like Windows, Linux, etc., each in its own VM. 3. What is Cloud Computing? ® Cloud computing is the delivery of computing services (servers, storage, databases, networking, software) over the internet. @ It is based on virtualization. © Offers models like: ° laaS (Infrastructure as a Service) ° PaaS (Platform as a Service) ° SaaS (Software as a Service) Example: Google Drive, AWS, Microsoft Azure, Dropbox. 4. Difference Between Virtualization and Cloud Computing Feature Virtualizatio | Cloud n Computing ae Feature Virtualizatio | Cloud n Computing Definition Technology | Service that that creates | delivers virtual computing resources over the internet Dependency | Independent | Depends on technology virtualization Purpose Maximizes Provides hardware scalable use resources and services Resource Local or Remote via Access on-premise | internet Example VMware, AWS, Azure, VirtualBox Google Cloud 5. Why is Virtualization Needed in Cloud Computing? Enables resource abstraction and isolation. @ Supports multi-tenancy (running multiple applications/users on same hardware). ® Enables elasticity and scalability in cloud services. e Allows for efficient utilization of hardware. e Helps in disaster recovery and load balancing. 6. Advantages of Virtualization Over Cloud Computing Feature Virtualization Advantage Cost-Effective for Small Setups More affordable for businesses not needing cloud scale Better Control Complete control over the infrastructure and configurations Security On-premise virtualization is often more secure and private No Internet Can work without Dependency internet access unlike most cloud services Customizability Allows deep customization of VMs, OSs, and configurations Performance Offers better performance in specific, dedicated use cases 7. Conclusion Virtualization and cloud computing are closely linked, but virtualization is a technology, while cloud computing is a service built on that technology. Virtualization improves efficiency, reduces Costs, and enables rapid deployment, which are all essential to the foundation of cloud computing. However, virtualization offers more control and security in isolated environments, making it preferable in certain enterprise setups. How MongoDB Connects with [Link] Application 1. Introduction MongoDB is a NoSQL database used in full stack web development to store and manage data in a flexible, document-oriented format. [Link] is a server-side runtime environment that allows developers to build scalable web applications. To connect [Link] with MongoDB, developers commonly use Mongoose, an Object Data Modeling (ODM) library. 2. Required Tools *® [Link] - Backend JavaScript runtime * MongoDB - NoSQL database * Mongoose - ODM for MongoDB e [Link] — (optional) Web framework for API 3. Installing Dependencies Bash © Copy code npm init -y npm install mongoose express body-parser 4. Establishing a Connection to MongoDB Using Mongoose: Js ©) Copy code // [Link] or inside [Link] const mongoose = require('mongoose'); mongoose. connect('mongodb: //localhost: 27017 /mydb', { useNewUrlParser: true, useUnifiedTopology: true 3) .then(() => console. log( 'MongoDB Connected')) .catch((err) => console. log(' Connection Error:", err)); 5. Creating a Data Model (Schema) Js © Copy code const mongoose = require('mongoose'); const userSchema = new mongoose. Schema({ name: String, email: String, age: Number 1); const User = [Link]("User", user Schema) ; [Link] = User: Vv MongoDB Database Connection with [Link] 1. Install Required Packages Bash () Copy code npm install mongoose 2. Import and Connect Mongoose Js © Copy code const mongoose = require( ‘mongoose’ ); mongoose. connect ('mongodb: //localhost: 27017 /mydb', { useNewUrlParser: true, useUnifiedTopology: true +) .then(() => console. 1log("MongoDB Connected") ) -catch((err) => console. log(err)); 3. Create a Schema and Model Js © Copy code const userSchema = new mongoose. Schema({ name: String, email: String +); vw Se eS a a 4. Use Model to Add or Retrieve Data Js (©) Copy code // Add user const user = new User({ name: "John", email: “john@[Link]" }); user .save(); // Get users User. find().then(data => console. log(data)); Hu 3:05 m3 @ orl! aD = ChatGPT GZ: 1. Setup and Installation First, create a project and install dependencies: Bash ©) Copy code npm init -y npm install express ejs 2. Project Structure © Copy code project-folder/ | L- views/ | L— [Link] | L— [Link] 3. [Link] (Main JS Program) Js © Copy code const express = require('express'); const app = express(); // Set EJS as the template engine [Link](‘view engine’, ‘ejs'); // Home route [Link]('/', (req, res) => { const user = { name; ‘Alice’, email: 'alice@[Link]' ts [Link]('index', { user }); }): // Start the server app. listen(3000, () => { console. log("Server running on [Link]"); +); 4. views/[Link] (Template File) Html 0) Copy code Welcome Page

Welcome, <%= [Link] %>!

Your email: <%= [Link] %>

ra No Ew ' al 5. Run the App Bash CO) Copy code node [Link] Then visit: http: //localhost:3000 1. What is NPM? NPM (Node Package Manager) is the default package manager for [Link]. It helps developers: ® Install libraries (called packages/modules) e Share code with others e Manage project dependencies 2. Key Features of NPM Feature Description Package Installs [Link] Installation libraries using CLI Version Control Manages package versions using [Link] Dependency Management Keeps track of required modules Script Execution Allows running custom commands via scripts Online Registry Offers access to over IM+ open-source packages at [Link] 3. Basic NPM Commands Command Description npm init /npm init -y Create a [Link] file npm install Install a package (e.g. npm install express) npm install Installs all dependencies listed in [Link] npm uninstall Removes a package npm update Updates packages to the latest versions npm list Shows all installed packages npm run