Dynamic data

Ok now here’s a question that will maybe seem stupid to most of you. Or not. I have no idea. I’m not even sure i am asking in the right part of the forums (sorry if it is the case). Ok here it goes: I am developing my own range of web applications, for our internal website, including a chat client and whatnot. I intend to release all source codes for free under no license whatsoever as soon as they are good enough for me. I am a hobbyist coder, but I have more or less mastered actionscript 2, know a good deal of as3, I use ajax/js without thinking and I know enough PHP to do whatever I want. I still call myself an amateur because I am learning those when I need them, for the requirements of a particular project. I am explaining all this because I don’t want you to think I am a total idiot.
Because something puzzles me a lot: The only way I know of storing data and retrieveing it is by using SQL (…or text files…). This works for most applications, but I wonder if this is how it is done professionally, for, say, a chat client. I have developed functional chat clients cores, but what I do is I store user/text and do a refresh on all clients every x seconds. It works for our internal website - we are only a handful of partners . But wouldn’t it put a lot of strain on a server if this system is used on large-scale applications? Is this how it is done, ideally?
In a nutshell, my question is: beside storing the data somewhere and refreshing the clients, is there a way to make the server *send *the data to the target client when needed?
Another question, a bit off-subject though: in the event I need quick data storing and retrieval, and I don’t need any of SQL’s features, is it virtually as efficient to retrieve them from a textfile?
Maybe my questions are basic, and I don’t ask as much as a complete explanation. I can read and learn about technologies by myself, the only thing here being, I don’t know what to search for!
thanks in advance. I hope my English is clear enough.