By a persistent socket I mean you connect once, then just send data to/from the server, rather than constantly connecting/sending/receiving/disconnecting which is what http normally does. Having a constant connection allows the server to be able to push data to the browser when it is necessary, rather than the browser having to constantly check in with the server to see if anything has changed. If there is no changes, no data is sent saving bandwidth and processor power.
When you say a persisten socket, does this mean the chat table is being queried like every second in essense?( For a chat room for example) or only when new data is available?
As far as querying the chat table, that all depends on how you want to setup the server side of things. You could just have your server setup so that when someone sends a message, the server accepts it and then re-distributes it to all connected clients and never even involve a database table. This is how IRC works for example. If you wanted to store a complete chat history then you'd still need to write it to a table, but you only need to write it, not re-select it for each client.
Even if it does do it when new data is available a simple 10-20room chat room with all active users using socket.io wouldn't that just rape the server?
# of rooms is irrelevant. # of connected clients is what you need to be concerned with. 1 room with 100 people is the same load as 10 rooms with 10 people each, more or less. How many clients your server would be capable of supporting depends on how well the chat software is coded and server specs. A low-end VPS (512-1gig ram) should easily be able to handle a few hundred users. Depending exactly on what you need/want the chat to do obviously.
Would this be why sometimes if u DC you lose data on ur character because it wasn't saved to Server? (Wouldn't this need to be updated like every second as well) for no data loss?
Possibly, although just because the client disconnects does not mean the server would fail to save the data. For that to happen, something would have to happen on the server end, such as a crash or power outage.
How do these servers perform so good under these load, I dont get it :/
Also you need to keep in mind that these big MMO's you compare to have LOTS of servers, possibly with some pretty high-end specs. Also, keep in mind that a lot of the interaction with the database is going to be SELECT queries, just reading out things like character/mob specs, loot tables, etc. There would be quite a bit fewer write operations going on. To handle all the SELECT's you use replication to distribute the load among several different slave read-only DB servers. Write operations would be directed at the master server which then relays those changes to all the slaves.
Also, does every windows programmed MMO/Multiplayer game have to use Winsock?
Every piece of windows software that connects to a network at all uses winsock. Winsock is windows' sockets implementation which drives all socket base communications. Go to the full post