实现聊天系统:在哪里存储聊天数据? [英] Implementing chat system: where to store chat data?

查看:976
本文介绍了实现聊天系统:在哪里存储聊天数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实现在asp.net聊天系统,就像谷歌聊天和我使用xmhttp发送和接收数据,我使用一个表来存储所有用户的所有聊天。

i am implementing a chat system in asp.net, much like google chat and i use xmhttp to send and receive data, and i am using a single table to store all chat for all user.

我想用XMLHtt prequest以便ABL组织更好的数据(而不是存储在一个事务所表可以(我不肯定知道所有的聊天中创建SQL全局临时表)引起锁定问题时,很多用户访问它。)

i wanted to create global temporary tables in sql using a XMLHttpRequest so as to be abl to organise data better(instead of storing all the chat in a sigle table which can(i dont know for sure) cause locking issues when many users are accessing it.)

也为我的系统我没有保存聊天,所以我认为一个全局临时表会更好,因为它已经被删除救我清除它的麻烦。

also for my system i don't have to store the chat and so i thought that a global temporary table would be better since it will already be dropped and save me the trouble of clearing it.

但该表已被Xmlhtt prequest它只是被创建后回落创建之后....为什么发生这种情况,我不知道....我也删除了所有的连接线收盘,但仍然没有运气

but the after the table has been created by the Xmlhttprequest it gets dropped just after its creation....why this happen i don't know....i also have removed all connection closing lines but still no luck

所以我应该怎么办?同时,如果任何人的,可以指出我的最佳做法遵循任何在线资源知道请告诉我。

so what should i do?? also if anyone knows of any online resources that can points me about best practices to follow please tell me.

推荐答案

您的表不会有很多用户访问它锁定问题。临时表是注定不会被共享交叉调用,你要与远路障沿着这条道路清盘。这可能是更好的只是你的数据存储在一个表中,然后轮询表。

Your table won't have locking issues with many users accessing it. Temporary tables are not meant to be shared cross-call, and you're going to wind up with far more roadblocks down that path. It is probably better to simply store your data in a table, then poll the table.

,你可以有锁定问题唯一的时间是,如果用户试图在同一时间...不应在聊天应用程序发生在相同的数据块写入到同一行。

The only time you could have "locking issues" is if the users are attempting to write the same chunk of data to the same row at the same time ... which shouldn't be happening in a chat application.

此外,谷歌聊天使用COMET风格实现,而不是轮询的实现。这一直是我的经验,COMET>轮询在用户体验方面。

Additionally, Google Chat uses a COMET style implementation instead of a polling implementation. It has been my experience that COMET > polling in terms of user experience.

这篇关于实现聊天系统:在哪里存储聊天数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆