In this article I cover a number of different concepts and technologies; Web Sockets, Python, Node, Vue JS, Docker, and bring them all together in a microservice architecture.
3 Microservices
Each component in this stack will be a microservice. I will take you through building each one, including running them in separate Docker containers.
Microservices bring with them immense flexibility, scalability, and fault tolerance. Today we will only cover the flexibility. Scalability and Fault tolerance require other technologies such as Kubernetes which are outside the scope of this article.
The flexibility of Microservices is created by each service being independent of the others and importantly only doing one job.
Taking the example we are looking at in this article, we could easily swap out the VueJS front end and replace it with react.
Or we could add a Mongo DB Microservice and store all tweets for analysis at a later date.
I have setup a demo site of what I am going to develop in this article. You can view it here http://medium-microservices.simoncarr.co.uk/
Of course this is just the VueJS front end, but underneath all the goodness of Python, Node, WebSockets and Docker are at work.
Here is how I am going to approach this project
All of the code for this project is available on GitHub
Twitter Client (Python)
https://github.com/simonjcarr/medium_microservices_twitter_client
Websocket server (NodeJS)
https://github.com/simonjcarr/medium_microservices_websocket_server
Twitter stream UI (VueJS)
https://github.com/simonjcarr/medium_microservices_twitter_ui
docker-compose file
https://github.com/simonjcarr/medium_microservices_docker_compose
The images used in the docker-compose file need to be built first. You can use the Dockerfile’s in the above repos or follow the rest of this article to learn how to do it.
#microservices #nodejs #docker #javascript #vuejs #programming