VProfile Project Setup¶
This was a learning course project where I deployed a multi-tier web application stack locally on my computer. I used various technologies Vagrant virtual machines, Nginix, Apache Tomcat, MySQL, RabbitMQ and others
Architectural Overview¶
A brief look at how the services are architecturally designed to interact:
- User Request Handling: The user sends a request via a browser, hitting the Nginx service, which then routes the request to the appropriate Tomcat server.
- Application Processing: Apache Tomcat processes the application logic and interacts with MySQL for data retrieval or storage.
- Caching Mechanism: Frequent database queries are cached by Memcached, enhancing the responsiveness of the application.
- Message Queuing: RabbitMQ handles messaging requirements, linking different services asynchronously to improve performance.
Architecture
First, I prepared the environment using Oracle VM Virtual Box as a hypervisor to host our virtual machines. I automated the setup process using Vagrant, which allowed me to configure and provision VMs efficiently. For command execution and version control, I used Git Bash. During development, I opted for Sublime Text as my primary IDE for code editing.
Tools used:
- Hypervisor: Oracle VM Virtual Box
- Automation: Vagrant
- Command Line Tool: Git Bash
- IDE: Sublime Text
Implementation Steps¶
- Starting the VMs: I initiated the project by setting up virtual machines using Vagrant. This automated the creation of a clean, isolated environment for each service in our stack.
Setup Code
- Configuring Services:
- Nginx: Configured as a load balancer to distribute incoming user requests.
- Apache Tomcat: Deployed as a Java web application server.
- MySQL: Set up to handle database requests for user authentication and data storage.
- Memcached: Implemented to speed up database interactions by caching frequent queries.
- RabbitMQ: Integrated as a messaging broker to facilitate asynchronous communication between services.
Testing and Validation: After setting up each service, I tested the entire stack by accessing the web application through a web browser using the IP address, ensuring all components worked seamlessly together.
Scripting and Automation: I wrote batch scripts to automate the deployment of services like Nginx, Apache Tomcat, and MySQL. This automation ensures that the setup can be replicated quickly and accurately, reducing manual setup errors.
Automation Script