Skip to content

Commit 6a8d67b

Browse files
committed
Memcached
1 parent d17ac45 commit 6a8d67b

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3273,8 +3273,46 @@ Q.fcall(promisedStep1)
32733273
<b><a href="#">↥ back to top</a></b>
32743274
</div>
32753275

3276-
#### 75Q. ***How to use locale (i18n) in Node.js?***
3277-
#### 76Q. ***How to implement Memcached in Node.js?***
3276+
## 75Q. ***How to implement Memcached in Node.js?***
3277+
3278+
**Memcached** is a general-purpose distributed memory caching system. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source (such as a database or API) must be read. Memcached is free and open-source software, licensed under the Revised BSD licence. Memcached runs on Unix-like operating systems (at least LINUX and OS X) and on Microsoft windows.
3279+
3280+
We can store data to memcached server in key pair format. So whenever any request come from the app can be matched with memcached server without any query from mysql/Nosql server. This increases the performance of the application.
3281+
3282+
**Installation**
3283+
3284+
```bash
3285+
npm install memcached
3286+
```
3287+
3288+
**Setting up the client**
3289+
3290+
The constructor of the memcached client take 2 different arguments server locations and options. Syntax:
3291+
3292+
```bash
3293+
var Memcached = require('memcached');
3294+
var memcached = new Memcached(Server locations, options);
3295+
```
3296+
3297+
**Example usage**:
3298+
3299+
```js
3300+
var Memcached = require('memcached');
3301+
// all global configurations should be applied to the .config object of the Client.
3302+
Memcached.config.poolSize = 25;
3303+
3304+
var memcached = new Memcached('localhost:11211', {retries:10,retry:10000,remove:true,failOverServers:['192.168.0.103:11211']});
3305+
```
3306+
3307+
<br/>
3308+
3309+
**[[Reference](https://www.npmjs.com/package/memcached)]**
3310+
3311+
<div align="right">
3312+
<b><a href="#">↥ back to top</a></b>
3313+
</div>
3314+
3315+
#### 76Q. ***How to use locale (i18n) in Node.js?***
32783316
#### 77Q. ***Explain error handling in Node.js?***
32793317
#### 78Q. ***How to generate and verify checksum of the given string in Node.js***
32803318

0 commit comments

Comments
 (0)