Re: [sqlite] Suggestion for project: Chat
On 24/08/10 17:21, Artur Reilin wrote: > I thinking about coding a chat with sqlite. You know the most hosts not > allow you to use chats or something that way, because they write and read > to often data from mysql database. > > So my thought is to make a chat which use forums software mysql tables for > user data, but writes and read chat text from sqlite database. As the chat > content get pruned after some time, the database can't grow big. So the > insert and selects should be fast. > I have already made a chat that uses SQLite. Its available to clone from my git repository (licenced under the GPL). See http://www.chandlerfamily.org.uk/content/software To clone the repository you need git clone git://www.chandlerfamily.org.uk/mbchat.git This originally started life as an mysql database version, but using it on the web site I wrote it for (http://www.melindasbackups.com) it ran out of steam when 20 people were using it (as it had to poll the database every 2 seconds per user to get a sensible performance). I went through some intermediate stage of using named pipes and sqlite before landing on the current version that forks a chat server for the time that anyone is in chat. I have also added optional security controls so that its possible to encrypt chat messages. It has multiple rooms which are added via adding them to the database, and various permissions and colours for users. (users see some rooms as public, others are moderated, and others they see only when they are members of a specific group - we used them as committee rooms). There is a useable demo here http://chat.hartley-consultants.com/ which is stand alone. The code can also link to an SMF forum and derive username from the login identity of the user on the forum. -- Alan Chandler http://www.chandlerfamily.org.uk ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Suggestion for project: Chat
> On Tue, Aug 24, 2010 at 10:23:55PM +0530, Roger Binns wrote: >> On 08/24/2010 09:51 PM, Artur Reilin wrote: >> > I thinking about coding a chat with sqlite. >> >> The hard part of implementing chat is not storing the messages, but >> rather dealing with all the clients at the same time especially with >> potentially hostile networking (eg reading data slower than you send >> it). >> >> If you want to write one yourself I suggest looking into the Erlang >> programming language. >> >> Instead of reinventing the wheel, I suggest you use the open XMPP chat >> protocol and open source XMPP servers. In addition to using any XMPP >> client, you can also use a web based client. > > +1. > > Moreover, because often you'll want to log chats hosted on services that > you do not control, the simplest, most popular, and most interoperable > (though not most reliable) way to log is to do it via "bots". "Bots" > are automated clients. > > The most reliable way to log chats is by modifying the service > implementation or by co-locating logger bots with the service, but this > only works when you own the service (or otherwise can get the owners to > log this way). > > Don't reinvent the wheel, just find a suitable open source bot and > modify it to suit your needs. You might even find some existing ones. > For example, the "Sqlite Users" wiki page [0] lists one exact match, > though it appears to be dead. > > Just search for "chat bot logger sqlite", "xmpp bot logger sqlite", > etcetera, and you'll find plenty. I count at least a handful just on > the first page of results for each of those searches. > > Nico > > [0] http://www.sqlite.org/cvstrac/wiki?p=SqliteUsers > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > The thing is, I don't want to log the chat text. It should just get removed after 30 messages or so. It should just save the chat messages for some time. I currently using a Ajax based chat in my phpBB3 installation. Just thought it would reduce the server <-> mysql server data traffic. I have paid hosting, so I don't think that I'll get many problems. But the thing is, that I see sometimes that the chat's are more html based and often really slow. So slow, that even sqlite could take that with 20 users at once or even more. with best wishes Artur Reilin sqlite.yuedream.de ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Suggestion for project: Chat
On Tue, Aug 24, 2010 at 10:23:55PM +0530, Roger Binns wrote: > On 08/24/2010 09:51 PM, Artur Reilin wrote: > > I thinking about coding a chat with sqlite. > > The hard part of implementing chat is not storing the messages, but > rather dealing with all the clients at the same time especially with > potentially hostile networking (eg reading data slower than you send it). > > If you want to write one yourself I suggest looking into the Erlang > programming language. > > Instead of reinventing the wheel, I suggest you use the open XMPP chat > protocol and open source XMPP servers. In addition to using any XMPP > client, you can also use a web based client. +1. Moreover, because often you'll want to log chats hosted on services that you do not control, the simplest, most popular, and most interoperable (though not most reliable) way to log is to do it via "bots". "Bots" are automated clients. The most reliable way to log chats is by modifying the service implementation or by co-locating logger bots with the service, but this only works when you own the service (or otherwise can get the owners to log this way). Don't reinvent the wheel, just find a suitable open source bot and modify it to suit your needs. You might even find some existing ones. For example, the "Sqlite Users" wiki page [0] lists one exact match, though it appears to be dead. Just search for "chat bot logger sqlite", "xmpp bot logger sqlite", etcetera, and you'll find plenty. I count at least a handful just on the first page of results for each of those searches. Nico [0] http://www.sqlite.org/cvstrac/wiki?p=SqliteUsers ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Suggestion for project: Chat
FWIW: The SQLite Core developers all keep in touch using a private, proprietary chatroom that is backed by an SQLite database. The chat server is written in 152 lines of Tcl code and the client (involving a GUI and therefore being more complex) is 1068 lines of Tcl/Tk. We have other means of communication available as a backup (Gmail chat, AOL chat, Skype) but our private chatroom works so well, that the backups are seldom used. On Tue, Aug 24, 2010 at 12:21 PM, Artur Reilin wrote: > I thinking about coding a chat with sqlite. You know the most hosts not > allow you to use chats or something that way, because they write and read > to often data from mysql database. > > So my thought is to make a chat which use forums software mysql tables for > user data, but writes and read chat text from sqlite database. As the chat > content get pruned after some time, the database can't grow big. So the > insert and selects should be fast. > > But would that work? What do you think? > > I'll like to write that for phpBB3 and wbb2 to replace the current chat > from my forum and also replacings wbb2 stinky chat system xD. > > With best wishes > > Artur Reilin > sqlite.yuedream.de > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Suggestion for project: Chat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/24/2010 09:51 PM, Artur Reilin wrote: > I thinking about coding a chat with sqlite. The hard part of implementing chat is not storing the messages, but rather dealing with all the clients at the same time especially with potentially hostile networking (eg reading data slower than you send it). If you want to write one yourself I suggest looking into the Erlang programming language. Instead of reinventing the wheel, I suggest you use the open XMPP chat protocol and open source XMPP servers. In addition to using any XMPP client, you can also use a web based client. Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxz+RgACgkQmOOfHg372QQArwCfSaFfSfzILiZWs6Z0eaAmAzD3 oSoAoL+onPhAEb/FCPDRmIkuuwDt3Sth =G+i4 -END PGP SIGNATURE- ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Suggestion for project: Chat
I thinking about coding a chat with sqlite. You know the most hosts not allow you to use chats or something that way, because they write and read to often data from mysql database. So my thought is to make a chat which use forums software mysql tables for user data, but writes and read chat text from sqlite database. As the chat content get pruned after some time, the database can't grow big. So the insert and selects should be fast. But would that work? What do you think? I'll like to write that for phpBB3 and wbb2 to replace the current chat from my forum and also replacings wbb2 stinky chat system xD. With best wishes Artur Reilin sqlite.yuedream.de ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users