php - How to store chat history in web chat app -


i working on company intranet has embedded chat client users can talk each on intranet.

i'm using guide http://www.sanwebe.com/2013/05/chat-using-websocket-php-socket work on basis of chat client , have working users can talk each other privately. want able though maintain chat history if refresh page or if switch between pages.

not sure best way store is, whether in database, store socket information in chat server or store in session or cookie array.

thanks can provide

storing chat history in redis ideal. there several redis clients available php: http://redis.io/clients#php.

depending on amount of traffic get, archive old chats mysql or other database @ later time. you'd want use redis while conversation active can write , read extremely (great chatting on sockets).

here's example of using php & redis chat service step-by-step examples: http://www.9lessons.info/2014/01/getting-started-with-redis-chatting.html


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -