Home / Companies / SurrealDB / Blog / Post Details
Content Deep Dive

Social graphs for activity-tracking apps

Blog post from SurrealDB

Post Details
Company
Date Published
Author
Martin Schaer
Word Count
2,318
Company Posts That Month
12
Language
English
Hacker News Points
-
Summary

The text discusses how activity-tracking and social-fitness apps can benefit from using a graph-based model to manage their social features, such as followers, kudos, comments, and segment leaderboards. By employing SurrealDB, the model allows athletes, activities, segments, and clubs to be represented as nodes, with relationships like follows, recorded, kudos, comments, efforts, and memberships as edges. This structure simplifies complex queries such as friend-of-friend suggestions, network-scoped leaderboards, and engagement metrics, which would otherwise require cumbersome join tables and recursive common table expressions (CTEs) in relational databases. Key advantages include the ability to perform efficient two-hop traversals, maintain unique relationships, and directly associate data with relationships, such as comment text or kudos timestamps. The article provides a practical guide to implementing this model, including schema definitions and sample queries, offering a scalable and unified approach to managing social interactions within fitness apps.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
AI Agents 1 4,874 1,103 240 -1%