Nathan Heffley
NathanHeffley
Product Developer |
Recent Tech Decisions
12 points

Following

  • Pusher

    NathanHeffley Pointer


    In the original prototype all the communication was handled by a backend server. Each client connected directly to the server using the socket.io library. This quickly proved to be messy and unreliable, especially on the cheap server being used to host it.

    Websockets proved to be a little more reliable, but still just as messy and not all browsers support them. That's when the project was switched over to use Pusher. Using Pusher has allowed all but the initial connection code to be off-loaded onto the client. Now instead of communicating through a self-hosted server, clients can communicate pretty much peer-to-peer over Pusher.

  • AWS Lambda

    NathanHeffley Pointer


    To use Pusher's presence channel each client must be connected through a backend authentication system. While Pointer doesn't actually have any login based authentication it still needed a backend system to connect users to the proper channel.

    A small function was built that only gets called when a user first joins a session. After the user is authenticated they can communicate directly with other clients on the same channel. This made the authentication code the perfect candidate for a serverless function. Using AWS Lambda through Netlify's Functions feature made it a breeze to host.