开发者

AJAX Chat, implement server with DB or as a windows service?

I am implementing an AJAX chat. No worries there but I was thinking of how to implement the server side code.

At the moment I write from a DB when a user sends and reads from the DB when a user requests his messages. I am thinking that this is not the most eff开发者_JAVA技巧icient way as I am writing and reading all the time.

My plan was to implement I windows service that would keep the messages in memory until the user requests or send it back to sender if there is no request. For scaling this might be better as I can just install the service on many servers and using a load balancer to send to the correct server?

Please tell me which way is best, service or by database?


I would go with the database approach: It is more easy at the beginning to implement and test. If you provide a good API layer to the database storage you could replace the database with your service later, if you need the additional features. However scaling and load balancing can also be achieved with databases...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜