tschellenbach/Stream-Framework — dự án dữ liệu — đang có 4.7k sao GitHub trong nhóm Data. Stream Framework is a Python library, which allows you to build news feed, activity streams and notification systems using Cassandra and/or Redis. The authors of Stream-Framework also provide a cloud service for feed technology:
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Stream Framework is a Python library which allows you to build activity streams & newsfeeds using Cassandra and/or Redis. If you're not using python have a look at Stream, which supports Node, Ruby, PHP, Python, Go, Scala, Java and REST.
Examples of what you can build are:
Activity streams such as seen on Github
A Twitter style newsfeed
A feed like Instagram/ Pinterest
Facebook style newsfeeds
A notification system
(Feeds are also commonly called: Activity Streams, activity feeds, news streams.)
Stream
Stream Framework's authors also offer a web service for building scalable newsfeeds & activity streams at Stream.
It allows you to create your feeds by talking to a beautiful and easy to use REST API. There are clients available for Node, Ruby, PHP, Python, Go, Scala and Java. The Get Started page explains the API & concept in a few clicks. It's a lot easier to use, free up to 3 million feed updates and saves you the hassle of maintaining Cassandra, Redis, Faye, RabbitMQ and Celery workers.
Background Articles
A lot has been written about the best approaches to building feed based systems.
Here's a collection of some of the talks:
Twitter 2013: Redis based, database fallback, very similar to Fashiolista's old approach.
Etsy feed scaling: Gearman, separate scoring and aggregation steps, rollups - aggregation part two
LinkedIn ranked feeds
Facebook history
Django project with good naming conventions
Activity stream specification
Quora post on best practices
Quora scaling a social network feed
Redis ruby example
FriendFeed approach
Thoonk setup
Yahoo Research Paper
Twitter’s approach
Cassandra at Instagram
Relevancy at Etsy
Zite architecture overview
Ranked feeds with ES
Riak at Xing - by Dr. Stefan Kaes & Sebastian Röbke
Riak and Scala at Yammer
Stream Framework
Installation
Installation through pip is recommended::
$ pip install stream-framework
By default stream-framework does not install the required dependencies for redis and cassandra:
Install stream-framework with Redis dependencies
$ pip install stream-framework[redis]
Install stream-framework with Cassandra dependencies
$ pip install stream-framework[cassandra]
Install stream-framework with both Redis and Cassandra dependencies
Next up we want to start publishing this activity on several feeds.
First of all, we want to insert it into your personal feed, and then into your followers' feeds.
Let's start by defining these feeds.
from stream_framework.feeds.redis import RedisFeed
class UserPinFeed(PinFeed):
key_format = 'feed:user:%(user_id)s'
class PinFeed(RedisFeed):
key_format = 'feed:normal:%(user_id)s'
Writing to these feeds is very simple. For instance to write to the feed of user 13 one would do:
feed = UserPinFeed(13)
feed.add(activity)
But we don't want to publish to just one users feed. We want to publish to the feeds of all users which follow you.
This action is called a "fanout" and is abstracted away in the manager class.
We need to subclass the Manager class and tell it how we can figure out which users follow us.
from stream_framework.feed_managers.base import Manager
class PinManager(Manager):
feed_classes = dict(
normal=PinFeed,
)
user_feed_class = UserPinFeed
def add_pin(self, pin):
activity = pin.create_activity()
# add user activity adds it to the user feed, and starts the fanout
self.add_user_activity(pin.user_id, activity)
def get_user_follower_ids(self, user_id):
ids = Follow.objects.filter(target=user_id).values_list('user_id', flat=True)
return {FanoutPriority.HIGH:ids}
manager = PinManager()
Now that the manager class is set up, broadcasting a pin becomes as easy as:
manager.add_pin(pin)
Calling this method will insert the pin into your personal feed and into all the feeds of users which follow you.
It does so by spawning many small tasks via Celery. In Django (or any other framework) you can now show the users feed.
# django example
@login_required
def feed(request):
'''
Items pinned by the people you follow
'''
context = RequestContext(request)
feed = manager.get_feeds(request.user.id)['normal']
activities = list(feed[:25])
context['activities'] = activities
response = render_to_response('core/feed.html', context)
return response
This example only briefly covered how Stream Framework works.
The full explanation can be found on the documentation.
Features
Stream Framework uses Celery and Redis/Cassandra to build a system with heavy writes and extremely light reads.
It features:
Asynchronous tasks (All the heavy lifting happens in the background, your users don't wait for it)
Reusable components (You will need to make tradeoffs based on your use cases, Stream Framework doesn't get in your way)
Full Cassandra and Redis support
The Cassandra storage uses the new CQL3 and Python-Driver packages, which give you access to the latest Cassandra features.
Build for the extremely performant Cassandra 2.1. 2.2 and 3.3 also pass the test suite, but no production experience.
tschellenbach/Stream-Framework thuộc nhóm Data trên TopGit, cùng 8 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về tschellenbach/Stream-Framework ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/tschellenbach/Stream-Framework là nguồn chính thức.
tschellenbach/Stream-Framework có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho tschellenbach/Stream-Framework. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
tschellenbach/Stream-Framework có trang demo không?
Dự án có trang chủ ở https://getstream.io/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
tschellenbach/Stream-Framework là gì?
tschellenbach/Stream-Framework (tschellenbach/Stream-Framework) là dự án Python trên GitHub. Theo mô tả gốc: Stream Framework is a Python library, which allows you to build news feed, activity streams and notification systems using Cassandra and/or Redis. The authors of Stream-Framework also provide a cloud service for feed technology:
Vì sao tschellenbach/Stream-Framework được xếp vào nhóm Data?
TopGit xếp tschellenbach/Stream-Framework vào nhóm Data dựa trên GitHub topics và mô tả của repo (gắn thẻ: "activity-feed", "activity-stream", "big-data"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về Stream-Framework?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về Stream-Framework.