What is a Web Server?
A system that listens for and responds to HTTP requests
What to Web Servers typically respond to requests with?
A single server can serve both applications and data.
What is an API?
Application Programming Interface
A way of externally accessing resources made available by a web service
We can think of requests to endpoints as being like a function/method call
Name the two key attributes of RESTful APIs
They are stateless
Uniform Interface
What are the 3 key features of Node.js?
Event driven execution
- When used properly, this allows for thousands of concurrent connections on a single thread
It is JavaScript
- This allows you to use the same language on both client and serverr
Node Package Manager
Should you use Asynchronous Execution loops or Synchronous Execution loops? Why
Asynchronous
Need to use a non-blocking I/O, otherwise functions in the stack that take a long time to execute will block execution for all users
Should you use the main thread for expensive computations?
No, never, and never synchronously wait for a response for some external system.
A function operating on the main thread blocks executions and makes the server unresponsive
What is Express?
A web application framework for node
Allows you to build web applications and services in node
How is data persistence maintained in a Node.js Server?
Node does not store data - it is designed to process HTTP requests.
Need to use a database for this
What is MongoDB?
A document oriented database
How is data stored in MongoDB?
Data is stored in a collection of JSON-like documents
It makes reading and writing from JS straightforward
The structure isn’t constrained - it can change within a collection from document to document