How would you advise managing likes / dislikes?

For example, if I were to create an app like Instagram, where each post displays the number of likes for each activity.

What streams do I need to create? What would make calls on the network look like they liked them and didn't work? Where can I get the number of likes associated with each post?

Can I do this all in a stream, or will I have to rely on another server?

+3


source to share


1 answer


There are two approaches you can take. One updates the original activity with a counter, the other uses our analytics.

When you add an activity, if you send us someone else's id and timestamp, you can later use that someone else's id to update the activity. Then in the activity metadata you can have a field to count the likes and each like / unlike will update the activity. If you look at the Instragram-clone project I built at the end of 2016, you can see an example of this in the Back code. Advantages / Disadvantages of this approach: Easy to manage yourself, but you need to send all the activity as it was (same timestamp and all other fields you sent originally), so you will need to store the data on your side as well. In addition, if a user follows the feed where this activity is stored, they may not see the updated content as a new activity in the feed.

Channels you need: https://getstream.io/blog/best-practices-for-instagram-style-feeds/
Inner code: https://getstream.io/blog/example-go-service-for-photo -sharing-app /



The second approach uses our analytics properties, which can track this metadata field in a different way, but the downside is that it is only available for our enterprise plans. You can take a look at our documentation page for information on how to use it.

Introduction: https://getstream.io/analytics/
Documentation: https://getstream.io/docs_analytics/#introduction

+3


source







All Articles