Skip to content

Commit

Permalink
adds devDependencies for tests #2
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Feb 16, 2015
1 parent 9d02728 commit ed38fa3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Need to store/access your data as ***fast*** as possible? Try Redis!

## [Why?](https://youtu.be/zeXv4bav54M?t=9s)

> "*40% of people will leave your site if it takes longer than 3 seconds to load...*"
https://econsultancy.com/blog/10936-site-speed-case-studies-tips-and-tools-for-improving-your-conversion-rate
> ***Never make people wait***; *Learn how to* ***cache your content/app with Redis***.

**Storing data** is a ***necessity*** for *all* (but the *simplest*) web applications.  
:computer: :iphone: :watch: :camera: :video_camera:   >  
:floppy_disk: & :open_file_folder:   >   :smile:
Expand Down Expand Up @@ -284,6 +289,13 @@ http://instagram-engineering.tumblr.com/post/12202313862/storing-hundreds-of-mil
+ Redis Labs Achieves Over ***1.2 Million Transactions per Second*** on a **Single** Amazon Web Services (AWS) **Instance**:
http://www.marketwired.com/press-release/redis-labs-achieves-over-12-million-transactions-per-second-on-single-amazon-web-services-1965269.htm

### Persistence

Because Redis is an in-memory datastore, persistence is not immediate.
if you want to be sure that your data is saved,
(incase your server/instance is re-booted) read about using the ***SAVE*** command.

+ Redis **persistence** ***demystified***: http://oldblog.antirez.com/post/redis-persistence-demystified.html


## Graphical User Interface (GUI) for Viewing/Setting Data
Expand Down Expand Up @@ -378,7 +390,6 @@ output:
![bicycle-definition](https://cloud.githubusercontent.com/assets/194400/7215446/4bbc5fd8-e5d0-11e4-80ca-a52d9265186f.png)



### Q: Can't I Just Use MongoDB for Everything?

> "We are *already using MongoDB* to store our records, can't we just put ***everything in one place***?"
Expand All @@ -392,3 +403,11 @@ But if you need to save/access ***Millions of Records Per Second*** (*yes, you r
then there's ***only one*** place to store your data; ***Redis***.

![there can be only one](https://izeeshan.files.wordpress.com/2014/08/there-can-only-be-one.jpg)


### Q: Can we use Redis as *Primary* Datastore?

*Quick answer*: ***Yes***!
*Long answer*:

+ **Persistence**: http://redis.io/topics/persistence +
6 changes: 0 additions & 6 deletions examples/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,3 @@ client.get("Hello", function(err, reply) {
// reply is null when the key is missing
console.log('Hello ' + reply);
});


/**
* BASIC Example using hiredis - https://github.com/redis/hiredis-node
* if you want the "Official" (but less popular) module
*/
19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
"version": "1.0.0",
"description": "A quick introduction to using Redis to store/retrieve data for your node.js app!",
"main": "server.js",
"scripts": {
"test": "tape",
"start": "node server.js"
},
"repository": {
"type": "git",
"url": "https://github.com/nelsonic/learn-redis.git"
Expand All @@ -29,5 +25,18 @@
"dependencies": {
"hiredis": "^0.3.0",
"redis": "^0.12.1"
}
},
"devDependencies": {
"codeclimate-test-reporter": "0.0.4",
"istanbul": "^0.3.13",
"tap-spec": "^3.0.0",
"tape": "^4.0.0"
},
"scripts": {
"view-cov": "open .",
"codeclimate": "CODECLIMATE_REPO_TOKEN=0839d00dd01047ffadfb3c56bf9c9baa0047179de582a47517e3f558ad4eafff ./node_modules/codeclimate-test-reporter/bin/codeclimate.js < ./coverage/lcov.info",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape ./api/test/*.js | node_modules/tap-spec/bin/cmd.js && ./node_modules/.bin/istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
"test": "istanbul cover ./node_modules/tape/bin/tape ./api/test/*.js | node_modules/tap-spec/bin/cmd.js",
"spec": "node ./node_modules/tape/bin/tape ./api/test/*.js | node_modules/tap-spec/bin/cmd.js"
}
}

0 comments on commit ed38fa3

Please sign in to comment.