Designing and implementing a backend Instant Messaging system. For this assignment, the focus will be on the backend only, focusing on core message features without the front-end part and the account/authentication part.
- Architecture: HTTP server and RPC server.
- Data Storage: To store the the messages data.
- Messages Delivery: deliver messages to the intended recipients in timely and consistent manner.
- Performance and Scalability: Able to handle a relatively large number of users and messages. (more than 20 concurrent users)
- For the database, Redis will be used. It is an open source in memory data and for this project advanced queries are not needed too.
- Golang is required to be installed on the computer. For this project, Golang IDE will be used
- Docker will be used to run this project.Hence, Docker will be required to be installed as well.
- Postman will be used to test out the API as well.
- right clock on docker-compose.yml and click on run. Wait for it to initialise and run.
- Atfter the setup is done, use Postman to test the APIs.
- Afterwards, use the cURL format to import the request and try sending the message.
- Note that the demo code logic has a 50% chance of getting a 200 Success Message or an 500 Internal Error.
- For Unit Testing, this project is unable to do as the database used in this case is Redis. It will not work as it cannot connect to the Redis server.
- For the handling of more than 20 concurrent users JMeter is used to test for this scenario. Use the JMeter file in the repo and the QPS can be changed in the thread group.
- Not yet implemented but if it is used Kubernetes cluster will be the way to go.
- Golang IDE (jetbrains): https://www.jetbrains.com/go/
- Redis: https://aws.amazon.com/redis/
- Docker: https://docs.docker.com/desktop/install/windows-install/
- Postman: https://www.postman.com/downloads/
- JMeter: https://jmeter.apache.org/download_jmeter.cgi
- Kubernetes Cluster: https://kubernetes.io/releases/download/