Future improvements

Though we've successfully made a chat server, there are a lot of places for potential improvement from both a usability and scalability standpoint. We talked about a number of potential scalability issues in several sections above. "An aside on the foreign key decision", "A future problem with auto-incrementing IDs", "Polling", and "Some expected bottlenecks". However, there are still a lot of usability improvements one could make, some of which would involve different scalibility concerns.

We could move to a web sockets model instead of using polling. The primary difference here is that instead of users constantly requesting messages, we would push new messages to the users via web sockets. This would greatly decrease the number if incomming requests, but it would greatly increase the number of open connections our servers have. In addition, we could combine a switch to web sockets with the introduction of a pub/sub mechanism, which would reduce query load on our database, but would require the setup of a system to handle pub/sub. A number of databases exist which handle pub/sub themselves, like Redis, and libraries exist to add pub/sub on top of existing databases like the SQLite we used here.


This page is a preview of Reliable Webservers with Go

Start a new discussion. All notification go to the author.