Chapter 8. Building a simple social network

 

This chapter covers

  • Users and statuses
  • Home timeline
  • Followers/following lists
  • Posting or deleting a status update
  • Streaming API

In this chapter, we’ll cover the data structures and concepts necessary to build a system that offers almost all of the back-end-level functionality of Twitter. This chapter isn’t intended to allow you to build a site that scales to the extent of Twitter, but the methods that we cover should give you a much better understanding of how social networking sites can be built from simple structures and data.

We’ll begin this chapter by talking about user and status objects, which are the basis of almost all of the information in our application. From there, we’ll discuss the home timeline and followers/following lists, which are sequences of status messages or users. Continuing on, we’ll work through posting status messages, following/unfollowing someone, and deleting posts, which involves manipulating those lists. Finally, we’ll build out a fully functioning streaming API with web server to encourage users of the social network to use and play with the data.

8.1. Users and statuses

8.2. Home timeline

8.3. Followers/following lists

8.4. Posting or deleting a status update

8.5. Streaming API

8.6. Summary

sitemap