SSD ICT Flashcards
Aim of backend?
Lays the foundational code
that enables websites to process actions that users take on front-end
and deliver correct information in return.
Purpose of backend
Handles the ‘behind-the-scenes’ functionality of web apps.
Manages user connections.
Powers the user interface of the web application.
Connects the web app to a dataase
Roles of back-end developer
Writing APIs & libraries.
Working on business processes and data architecture.
Writing code to interact with a database.
What does browser as host environment allow?
Capture of user’s input.
Making of HTTP requests.
Processing of JavaScript instructions to output HTML and CSS.
What is node.js
Open-source, cross-platform, back-end JavaScript runtime environment
Node.js as host runtime environment gives JavaScript access to OS
What does Node js allow js to do
- Be used as utility scripts to configure system and to read, write and manipulate files.
- Send and receive data over the network.
- Implement efficient web servers and attach application code to it.
- Make and serve HTTP requests.
What are the features of node.js
Open-source, cross-platform, back-end JavaScript runtime environment.
Event-driven architecture capable of asynchronous I/O operations
* reading from the network, accessing a database, modifying a file, etc.
Fully platform independent: Windows, macOS and Linux.
Full support for both types of databases:
* Relational DBs - Mysql
* NoSQL DBs -MongoDB
What is nodemon?
A package that automatically restarts the server if a change in the source code or file change in the directory is detected
What is dotenv?
Module that loads configuration environment variable from separate .env file.
What is express js?
Minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
Features of express js.
o It provides a robust set of features to develop web apps.
▪ It sets up handlers to respond to different HTTP requests.
▪ It performs different actions based on HTTP Method and URL
▪ It sets common web app settings such as connection port and template locations.
▪ Dynamically renders HTML Pages based on passing arguments to templates.
What is nvm?
A tool to manage the node version.
* Switch between different Node versions.
* Quickly update your installation when new releases are available.
What is npm?
- Package manager for JavaScript, default package manager for Node.js.
- Includes a registry i.e. an online catalogue of libraries, can be accessed via client
- Track what libraries your project is using (called dependencies)
- Download the packages they depend on (called subdependencies)
- Store versioning information.
- Distinguish between test and production builds.
How does Node js enable js everywhere
This allowed JavaScript:
o to be uncoupled from browser and to run on the server, including on cloud-based servers.
o to use the same language both on the server and client.
o to be used as part of several front-end frameworks (e.g., React, Vue.js, Angular) and back-end
frameworks (e.g., Express.js, Next.js, Sails.js
o to be used as part of several stacks e.g., MEAN stack (MongoDB, Express, Angular, Node) and MERN
stack (MongoDB, Express, React, Node).
When is node js most suitable?
For apps that require high scalability across multiple servers and DBMSs.
High perf apps with dynamic single-page applications (SPAs) that work in a data-intensive &
real-time manner, including distributed sessions across multiple devices.
Node js capabilities
Build software tools
Web scraping and testing
Build desktop applications
Build mobile applications
Build smartphone or tablet apps
Internet of Things (IoT)
What is Ejs?
o One of the most popular template engines for JavaScript.
o It enables to rapidly build web applications that are split into different components.
o It embeds JavaScript code in a reusable web template to generate HTML.
o It replaces the variables in a template file with actual values and displays this value to the client.
o It retains the syntax of HTML while allowing data interpolation.
What is a web template engine?
Software that combines web templates with a data source to generate
HTML by replacing variables in a template file with actual values.
data source - json, xml
web template - reusable template created using templating language
templating language - javascript java asp
What is Mongoose?
Object Data Modelling (ODM) library for MongoDB and Node.js.
It acts as a front-end to MongoDB
* MongoDB: document-oriented NoSQL database, stores data in BSON.
Advantages of nosql databases
Scalability - able to meet the needs for varying data loads.
What is a JSON document?
o Documents consist of name-value pairs.
o Names are strings.
o Values can be numbers, strings, nulls, arrays, or objects
What is a collection?
Gathering of documents.
Like a table in relational DB.
No need to specify a schema
Can change structure of docs in a collection.
Benefits of using mongodb as a DBaas
Cost savings - cost based on usage
Cheaper management - db management done by cloud provider, no need staff
Data Security - done by cloud service provider
Scalability - up/down based on requirements
What are environmental variables?
Variables that are set outside source code, often through a cloud provider or an Operating System
Supported by node and accessible via dotenv module.
Used to securely configure elements that dont change often. Like DB connection strings