This repository is a compilation of working code scripts that complete the O'Reilly session on Patterns for Distributed Systems The code here will be used during the session to reason and discuss various patterns and their benefits and applications.
The code here can remain an independent and open means of learning about the patterns. This guide outlines how different scenarios be executed and impact of pattern is visualized. The guide covers 5 specific patterns and their execution in the repository.
- Java 11
- Maven
- Springboot
- JMeter as load generation tool
- Influx db as timeseries store for load metrics
- Grafana as a visualization tool
- RabbitMQ as the distributed message queue
- Docker
Only basic Java knowledge is required to execute the patterns. All other components can be treated as a blackbox.
- Install Java with brew
brew install openjdk@11
- Install Docker Desktop from here
- Run docker desktop
- Install maven with brew
brew install maven
- Clone this repo
git clone https://github.com/priyaaank/patterns-distributed-systems.git
- Setup branches
git branch --track bulkheads origin/bulkheads
git branch --track bulkheads-fix origin/bulkheads-fix
git branch --track transientfailure origin/transientfailure
git branch --track transientfailure-fix origin/transientfailure-fix
git branch --track circuitbreaker origin/circuitbreaker
git branch --track circuitbreaker-fix origin/circuitbreaker-fix
git branch --track gracefuldegradation origin/gracefuldegradation
git branch --track batchtostream origin/batchtostream
git branch --track batchtostream-fix origin/batchtostream-fix
git branch --track backpressure origin/backpressure
git branch --track backpressure-fix origin/backpressure-fix
- Execute
./rebuild_and_restart.sh
- Execute following
curl
command in terminal to validate text, title, etc for url are bring returned
curl -X GET "http://localhost:8080/bookmark/enrich?url=https://github.com&fieldsRequested=title,text,longUrl,shortenedUrl,tags"
cd ~
git clone https://github.com/priyaaank/patterns-distributed-systems.git
apt-get install openjdk-11-jdk
apt-get install maven
- Follow instructions to install
docker
- Follow instructions to install
docker-compose
cd ~/patterns-distributed-systems
- Setup branches
git branch --track bulkheads origin/bulkheads
git branch --track bulkheads-fix origin/bulkheads-fix
git branch --track transientfailure origin/transientfailure
git branch --track transientfailure-fix origin/transientfailure-fix
git branch --track circuitbreaker origin/circuitbreaker
git branch --track circuitbreaker-fix origin/circuitbreaker-fix
git branch --track gracefuldegradation origin/gracefuldegradation
git branch --track batchtostream origin/batchtostream
git branch --track batchtostream-fix origin/batchtostream-fix
git branch --track backpressure origin/backpressure
git branch --track backpressure-fix origin/backpressure-fix
- Execute
./rebuild_and_restart.sh
- Execute following
curl
command in terminal to validate text, title, etc for url are bring returned
curl -X GET "http://localhost:8080/bookmark/enrich?url=https://github.com&fieldsRequested=title,text,longUrl,shortenedUrl,tags"
- Help needed to populate the instructions for installation
- Execute
mkdir -p load-testing/mount/
- cd into the directory
cd load-testing/mount/
- Download JMeter from here
- Extract files in the folder
load-testing/mount/
- Execute on command line
./apache-jmeter-5.4.3/bin/jmeter
- Download plugins manager for jmeter from here
- Move the downloaded jar to
load-testing/mount/apache-jmeter-5.4.3/lib/ext/
- Download influxdb2 metrics reporter jar from here
- Move the downloaded jar to
load-testing/mount/apache-jmeter-5.4.3/lib/ext/
- Restart Jmeter
- Open script
load-testing/scripts/Bulkheads.jmx
- If it prompts to install new plugins, click ok and install
Following is a short guide on executing load tests for specific scenarions and making observations
git checkout bulkheads
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/Bulkheads.jmx
and execute in JMeter - View
Transactions per Second
andSummary view
git checkout bulkheads-fix
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/Bulkheads.jmx
and execute in JMeter - View
Transactions per Second
andSummary view
git checkout transientfailure
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/TransientFailure.jmx
and execute in JMeter - View
Transactions per Second
andSummary view
git checkout transientfailure
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/TransientFailure.jmx
and execute in JMeter - View
Transactions per Second
andSummary view
git checkout transientfailure-fix
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/TransientFailure.jmx
and execute in JMeter - View
Transactions per Second
andSummary view
git checkout circuitbreaker
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/CircuitBreaker.jmx
and execute in JMeter - View
Transactions per Second
andSummary view
git checkout circuitbreaker-fix
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/CircuitBreaker.jmx
and execute in JMeter - View
Transactions per Second
andSummary view
git checkout gracefuldegradation
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/CircuitBreaker.jmx
and execute in JMeter - View
Transactions per Second
andSummary view
git checkout batchtostream
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/BatchToOLTP.jmx
and execute in JMeter - View
Transactions per Second
andSummary view
git checkout batchtostream-fix
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/BatchToOLTP.jmx
and execute in JMeter - View
Transactions per Second
andSummary view
git checkout backpressure
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/Backpressure.jmx
and execute in JMeter - View
Transactions per Second
andSummary view
git checkout backpressure-fix
./rebuild_and_restart.sh
- Open script
~/patterns-distributed-systems/load-testing/scripts/Backpressure.jmx
and execute in JMeter - View
Transactions per Second
andSummary view