Framework/Node.js
-
Data Caching with RedisFramework/Node.js 2020. 2. 22. 14:48
1. Overview Redis (Remote Dictionary Server) is an in-memory data structure project implementing a distributed, in-memory key-value database with optional durability. Redis supports different kinds of abstract data structures, such as strings, lists, maps, sets, sorted sets, HyperLogLogs, bitmaps, streams, and spatial indexes. 2. Intuition 2.1 Index search case We have this index over here for s..
-
Enhancing Node PerformanceFramework/Node.js 2020. 2. 21. 22:41
1. Overview 2. Intuition 2.1 Blocking the Event Loop const express = require('express'); const app = express(); function doWork(duration) { const start = Date.now(); while(Date.now() - start { doWork(5000); res.send('Hi there'); }); app.listen(3000) as soon as you and I start writing some javascript code that takes some amount of time to execute our en..
-
Single Thread, Event Loop, and Blocking CodeFramework/Node.js 2020. 2. 21. 21:16
1. Overview 1.1 Event Loop The event loop is automatically started by node.js when your program starts. This is responsible for handling event callbacks though. The event loop is responsible for basically running that code when a certain event occurs you could say, it's aware of all these callbacks and basically well, execute said code. It's important to understand that this operation is not han..
-
The Internals of Node.jsFramework/Node.js 2020. 2. 21. 14:33
1. Overview Node.js is an open-source, cross-platform, JavaScript library that executes JavaScript code outside of a browser. Node.js lets developers use JavaScript to write command-line tools and for server-side scripting—running scripts server-side to produce dynamic web page content before the page is sent to the user's web browser. Consequently, Node.js represents a "JavaScript everywhere" p..