Today every application indirectly uses the concept of activity stream but people do not know that there is a protocol defined by the community for this purpose only. So, What is Activity Stream? Activity Stream is a protocol(specification) for logging the business level events in a proper structured way. For ex: Facebook’s News Feed, Github activity feed etc. On any standard system, usually there is a lot of activities are going which we want to persist. We can take example of collaborative editor platform , social platform, order management system etc. And its better you use state machine on top of activity stream to impose rules on your system. Together both these things help you building a robust system. Let’s first discuss the specifications: In Activity stream you break the event into a English like sentence which has **Actor Verb Object Target** For example this event: So we can break it in the format of CustomerA placed an order for hotelA. **Actor** **verb** **object** **target** : customer_id Actor : placed/state verb : order_id object : hotel_id target Generally we create with the name of activity in which we have following fields/columns named: actor, verb, object, target, created_at/published_at. collection/table And then we break our business events/activities into verbs like: etc. placed, delivered, sent, dispatched and now think about our as t etc. object order/friend_request/demo_reques Finally the group, it can hold a like: . target single reference or group reference friend_id, hotel_id, document_id, group_id etc So in this way we log every business level event in a collection. First principle of using activity stream you never any event/activity. override And you avoid taking decision on the basis of activity collection. You just used it as read only. And use this info for latter analysis. You can bind these events for notifying the target customer or showing them them there activity logs etc. So using above approach you can easily built a news feed, activity manager etc. There is a lot of open source packages available which you can easily integrate with you system. For and you can refer these links: java python https://github.com/OpenSocial/activitystreams http://django-activity-stream.readthedocs.io/en/latest/streams.html Conclusion: I hope I explained everything clearly enough for you to understand. If you have any questions, feel free to ask. You can find me on twitter . Make sure you click on green heart below and follow me for more stories about technology :) is how hackers start their afternoons. We’re a part of the family. We are now and happy to opportunities. Hacker Noon @AMI accepting submissions discuss advertising & sponsorship To learn more, , , or simply, read our about page like/message us on Facebook tweet/DM @HackerNoon. If you enjoyed this story, we recommend reading our and . Until next time, don’t take the realities of the world for granted! latest tech stories trending tech stories