Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Node Web Development - Second Edition
  • Table Of Contents Toc
Node Web Development - Second Edition

Node Web Development - Second Edition

By : David Herron
4 (1)
close
close
Node Web Development - Second Edition

Node Web Development - Second Edition

4 (1)
By: David Herron

Overview of this book

Table of Contents (17 chapters)
close
close
Node Web Development Second Edition
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
1
Index

Asynchronizing the Notes application


The previous Notes application used a synchronous model for accessing the data model. We got away with that because the data was stored in memory, and there was no need to access model data via asynchronous functions. However, by storing the data in a database, we're in territory where we must access the data via asynchronous functions. Recall the discussion in Chapter 1, About Node, about the original reasoning behind Node's asynchronous architecture. Accessing data in memory takes a few clock cycles making it possible to directly operate on in-memory data without delays that would prevent the Node server from handling events. Data stored anywhere else, even in the memory space of another process, requires a delay to access that data, and any delay prevents the Node server from handling events.

Hence, converting the Notes application to use asynchronous operations to access the data is going to require some surgery.

What we're going to do is as follows...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Node Web Development - Second Edition
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon