Redis is a good fit for implementing session storage. Learn how to add this to your project.
- [Instructor] One typically used case for Redis…is session storage.…By now we use in memory sessions.…Remember that we used them to create so-called…flash messages, whenever we created an item or a user.…This works as long as there is only one process…that has to have access to the session.…As soon as you start using the cluster module…to utilize all CPUs or scale to multiple node instances,…this fails.…To add Redis as session storage,…we first need to install the module.…
The module for that is connect dash Redis…so I will install that now.…NPM install…dash dash save connect…dash Redis.…Next I will open…the app.gs file…and here…I see that we are already using express session…and after that I add const…Redis…store…equals require…Redis dot session…require…connect…dash Redis…and we parse in the session.…
Object of express session.…Next, let's scroll down a little bit…to see where the session is re-initialized…and here on line 19 you see that we are using session here.…And we will now add here…because luckily session is very pluggable.…
- Basics of relational and nonrelational databases
- Preparing your environment
- When to use document databases
- Inserting data into MongoDB
- Basic insert operations for MongoDB
- Querying data from MongoDB with Node.js
- Using key-value stores
- Using relational databases with Node.js
- Adding MySQL and Sequelize to a project
Skill Level Intermediate
Node.js: Build Your First Microservice (2016)with Daniel Khan2h 9m Intermediate
1. Get Started with Databases for Node.js
2. Prepare Your Environment
3. Use Document Databases with Node.js
4. Use Key-Value Stores with Node.js
5. Use Relational Databases with Node.js
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.