JavaScript patterns for scalable systems