Duration
3 days
Overview
Technology will never stand still. After 20 years of stateless web technology, solutions like Gmail and Facebook has inspired real-time websites with push capability. These real-time web applications are employing push technology over web sockets. Web solutions are being pushed to handle huge number of simultaneous connections with high throughput, which equates to high scalability. These connections are from various types of devices like mobile phones, IOT devices as well as the normal PC browsers.
Node.js shines in real-time web applications employing push technology over web sockets. Finally the Node.js technology allows us to have web applications with real-time, two-way connections, where both the client and server can initiate communication, allowing them to exchange data freely. Node really shines in building fast, scalable network applications, as it’s capable of handling a huge number of simultaneous. Compared to traditional web-serving techniques where each connection (request) spawns a new thread, taking up system RAM and eventually maxing-out at the amount of RAM available, Node.js operates on a single-thread, using non-blocking I/O calls, allowing it to support tens of thousands of concurrent connections.
Understanding the fundamental concepts of Node.js is very important for a fulfilling career in this area, even for those who are not working directly in this industry. For example a basic grasp of the subject area will enable a project manager to appreciate the technical challenge faced in the project or help a mechanical engineer understand why the circuit designer insists on specific technical decision.
With this objective in mind, this course is designed to equip participants with both foundation knowledge and broad appreciation of each underlying application, and therefore increased interest and confidence for their future undertaking. The subject is delivered with minimal complex equations, stressing on practical applications instead.
After over 20 years of stateless-web based on the stateless request-response paradigm, we finally have web applications with real-time, two-way connections. This course also includes MongoDB and also how to use the MongoDB open-source NoSQL document database in Node.js environment. Attendees learn Mongo's most compelling use cases and master the fundamentals of Mongo’s features.
Prerequisites
Before attending this course, students should have general programming experience and knowledge of HTML and CSS. All students should be familiar with basic programming in almost any scripting or object-oriented language (command-line scripting, database programming, or application programming), and have some experience with any SQL or NoSQL database.
Course Topics
Day 1
- Introduction to "Modern (ES5)" JavaScript
- Basic language features
- JavaScript types: Number, String, Boolean
- Variable declaration using let
- Operators – arithmetic, assignment, comparison
- Decision Making – if, else, switch case, double equal ==, triple equal ===
- Loops – for, while, do ... while
- Arrays, iterating arrays using for … in
- Functional Programming
- Functions
- Returning functions
- Parameterized functions
- Default function parameters
- REST parameters
- Anonymous functions and IIFE
- Function constructor
- Lambda functions
- Lambda statement
- Lambda expression
- Function hoisting
- Generated functions
- Object Oriented Programming - OOP
- Java Script Objects
- Object creation – Literal method, Using Object, Function constructor
- Properties, Methods
- Comparing Objects
- Object de-structuring
- JavaScript call, apply and bind
- Class
- Creating Objects
- Constructor
- Inheritance
- Method Overriding
- Collections – Map, Set
- Promise
- Importing a module
- Exporting a module
- Error Handling
- Syntax Errors
- Runtime Errors
- Logical Errors
- Throwing Exceptions
- Exception handling
- Custom Errors
- Node Projects
- The JavaScript Repository
- Node Package Manager (NPM)
- Creating a JavaScript project
- The package.json configuration file
- Installing Packages Global
- Installing Packages Locally
- Adding dependency in package.json
- Scripting through package.json
- Webpack Project
- HTTP
- The HTTP protocol
- Creating web server
- Handling http requests
- Sending requests
- Building an HTTP server
- Rendering a response
- Processing query strings
- Using Representational State Transfer
- Node JS Console
- Configuring TLS
Day 2
- File System
- Synchronous I/O vs. asynchronous I/O
- Path and directory operations
- __dirname and __filename
- Synchronous file reads
- Synchronous file writes
- Asynchronous file reads using Promises
- Asynchronous file writes using Promises
- Buffers, Streams, and Events
- Using buffers for binary data
- Flowing vs. non-flowing streams
- Streaming I/O from files and other sources
- Processing streams asynchronously
- Configuring event handlers
- Modules and Unit Testing
- Modularization
- The CommonJS and RequireJS specifications
- Defining modules with exports
- Modules are singletons
- Creating a package
- Module scope and construction
- Unit testing frameworks
- What to test and how to test it
- Building unit tests with Mocha
- Events
- When to use Event Emitters
- Binding Functions to Events
- Event Requests
- Event Listening
- What are callbacks
- Callback-last
- Callbacks: Error-first
- Errors in Event Emitters
- Uncaught Exceptions
- Using Domains
- Express
- The model-view-controller pattern
- Defining Jade and Handlebars templates
- Building a front-end controller
- Defining routes
- Creating actions
- Configuring Express to use Handlebars
- Using REST
- Reading POST data
- Building Handlebars helpers
- Adding middleware
Day 3
- Data Sources
- How Node.js connects to databases
- Configuration and platform setup
- RDBMS databases and NoSQL databases
- Connecting to RDBMS and NoSQL databases
- Performing CRUD operations
- Building client requests to web services
- MongoDB?
- The current SQL/NoSQL landscape
- Document-oriented vs. other types of storage
- Mongo's featureset
- Common use-cases
- Introduction to JSON
- Documents and Collections
- Creating documents
- Managing documents in collections
- Iterating over documents
- Simple Queries
- Field equality tests
- Operators available
- Projections
- Limiting results and paging
- Data Modelling
- Create Database
- Drop Database
- Create Collection
- Drop Collection
- Data Types
- Insert Document
- Query Document
- Update Document
- Delete Document
Day 4
- Queries
- Field equality tests
- Operators available
- Projections
- Limiting Records
- Paging
- Sorting Records
- Simple Updates and Deletes
- Field updates
- Field insertions
- Field removal
- Document deletion
- Existential field values
- More Complex Types of Queries
- Existential field values
- Aggregations and groups
- Aggregations and groups in hierarchical data
- Updates and Arrays
- Altering array field elements
- Insertion to array fields
- Removing from array fields
- Indexing
- The primary index and the _id field
- Problems requiring an index
- Defining secondary indexes
- Compound indexes
- Indexing 2
- Index selection
- Index hints
- Covering indexes
- Index storage size
- Indexes effect insertion and update speeds
- Mongo Replication and Sharding
- Configuring replication
- Configuring sharding
- Accessing clustered data from client APIs
- Latency and consistency in replicated and sharded Mongo
Day 5
- Creating a REST API with Node.js
Introduction
- Setting up Node Project with MongoDB for API
- Mongo RESTful API
- CRUD operations through REST
- Adding Data (POST requests in Node)
- Retrieving Data (GET requests in Node)
- Updating Data (PUT requests in Node)
- Deleting Data (DELETE requests in Node)
- Authentication and Security
- Setting up our User Model for Authentication in Node
- Authentication Middleware and Securing Resources in Node
- MapReduce
- Explanation of MapReduce
- Types of logic that can be expressed as MapReduce declarations
- Mapping documents
- Reducing values
- Mongo Security
- Authorization and securing collections, documents
- The limits of Mongo's authorization scheme
- Authentication
- Mongo in the enterprise
- Socket Programming
- Network Structure
- Classifications and Topologies
- Switching and Routing
- Gateway, Repeater, Hub, Bridge
- OSI & TCP/IP Protocol Layers
- Physical & Logical Addresses
- ARP & RARP Networking and TCP/IP Applications
- Internet Protocol
- Routing Protocol and IP Datagram
- Error and Control Messages (ICMP) UDP
- Transfer Control Protocol
- TCP Networking Applications
- (FTP, TFTP, TELNET, DNS, DHCP, SNTP, POP3, IMAP, SNMP)
Programme scope, delivery arrangements and suitability are confirmed during enquiry.