Permalink
Browse files

added line breaks

  • Loading branch information...
1 parent 1e04ffa commit a03bdedc4fc714e585feb8d519bc65e29badcaa5 @tlossen tlossen committed Apr 12, 2010
Showing with 11 additions and 3 deletions.
  1. +11 −3 recipes/4_higher_level_data_structures/implement_a_social_graph/recipe.md
@@ -1,10 +1,14 @@
### Problem
-You want to use Redis to implement a social graph for users in some kind of application, with one and two directional relationships available (following and friendship).
+You want to use Redis to implement a social graph for users in
+some kind of application, with one and two directional
+relationships available (following and friendship).
### Solution
-Use the built-in set functionality of Redis to construct `follow`, `follower`, and `blocked` lists keyed to each user's unique ID. In raw redis it looks something like this:
+Use the built-in set functionality of Redis to construct `follow`,
+`follower`, and `blocked` lists keyed to each user's unique ID. In
+raw redis it looks something like this:
redis> SADD user:1:follows 2
(integer) 1
@@ -23,7 +27,11 @@ Use the built-in set functionality of Redis to construct `follow`, `follower`, a
### Discussion
-Redis comes with the ability to construct "sets", which are collections of unique values assigned to a key. By creating both a "follows" and "followers" list for a given user, we are able to quickly and easily pull that information as well as calculate their "friendships" using a simple set intersection.
+Redis comes with the ability to construct "sets", which are
+collections of unique values assigned to a key. By creating both a
+"follows" and "followers" list for a given user, we are able to
+quickly and easily pull that information as well as calculate
+their "friendships" using a simple set intersection.
Implementing such a system in Ruby looks something like this:

0 comments on commit a03bded

Please sign in to comment.