如何将 Facebook 等多种活动数据与 SQL Server 结合起来?
我进行了搜索,但找不到适合我的解决方案。
我只是想知道 Facebook 或 Linkedin 如何用一句话处理相同类型的活动? 我的意思是,如果您将具有不同 ID 的每个活动存储在活动表中,您如何将它们列为“Member_a 和另外 15 个人更改了他们的照片”
我正在尝试为我的网站制作社交活动墙,这不是这么大,但我只是想知道这种情况的逻辑。
例如,当第一页加载时,我进行 Ajax 调用并列出 0-10 条记录,如果用户向下滚动,页面会进行另一个 Ajax 调用,列出 11-20 条记录。
现在;如果我尝试在 sql select 查询后使用 if else 组合相同类型的活动,如果这 10 条记录相同,用户将只看到 1 项。我希望我能解释我想说的:)
所以,我需要一个在 SQL 语句中进行此查询的解决方案。
我不是要求你为我写一个查询,我只是想知道逻辑。
这是我想要实现的屏幕截图:
您看,它们实际上是不同的存储数据,但它们将其组合起来并使其成为 1 项网络更新。
顺便说一下,我使用的是 C# 和 SQL Server 2008。
I have made a search but couldn't find a solution which works for me.
I just wonder how Facebook or Linkedin manages to handle same type activity with one sentence?
I mean, if you store every activity with different IDs in an Activity Table, how can you list them as "Member_a and 15 more people changed their photos"
I'm trying to make a social activity wall for my web-site, it's not that big but I just wanted to know the logic on this situation.
For example, when first page loads, I make an Ajax call and listing 0-10 records and if user scrolls down, page makes another ajax call which lists 11-20 records.
Now; if I try to combine same type of activity after sql select query with using if else, if this 10 records are the same, the user will only see 1 item. I hope I could explain what I want to say :)
So, I need a solution which makes this query in SQL Statement.
I'm not asking from you to write a query for me, I just want to know the logic.
Here is a screenshot what I want to achieve:
You see, they are actually different stored data but they combined it and made it as a 1 item network update.
By the way, I'm using C# and SQL Server 2008.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
例如:
我理解你的问题吗?
for example:
did I understand your question right?
将 PB 级数据作为一个表进行管理并不容易。因此,在 SQL Server 上运行的大型项目使用了一些高级扩展(分发数据和负载)技巧,例如服务代理和复制。
你可以检查
http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?CaseStudyID=4000004532 作为 SQL Server 示例。
It's not easy to manage petabytes of data as a one table. So, big projects running on SQL Server are used some advanced scaling(distributing data and load) tricks like Service Brokers and Replication.
You can check
http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?CaseStudyID=4000004532 as an SQL Server example.