Book Image

Flask Blueprints

By : Joel Perras
Book Image

Flask Blueprints

By: Joel Perras

Overview of this book

Table of Contents (14 chapters)

Social features – friends and followers


Many modern web applications allow users to friend or follow other users and be friended or followed themselves. While this concept may be simple to explain in words, there are numerous implementations and variations, all of which are optimized for their particular use-cases.

In this situation, where we want to implement a newsfeed-like service that displays information from a selected pool of users in an aggregated timeline that is unique for each authenticated user, the following are the three categories of approaches that may be used:

  • Fan-out on Write: Each newsfeed for a user is stored in a separate logical container with the intention of making reads exceedingly simple, fast, and straightforward, at the expense of denormalization and lower write throughput. The logical container may be a database table for each user (although this is highly inefficient for a large amount of users), columns in a column-oriented database such as Cassandra, or more...