Exam API is an idea I came up with in 2015. During my A Levels I found it difficult to work with mock examinations, they were badly formatted PDF's that were difficult to organise. Looking back at that model its surprising that such an archaic method is still used. The idea was to consolodate all exam questions in a data store that could be used to generate mock exams given certain parameters (keyword, year, subject, module, examboard and more).
As a lot of these applications are learning experiences I decided to try and use as many justifiable technologies as posible. The application was built with a micro service architecture in mind using spring cloud and deploying via docker. All CICD was done via CircleCI which takes a best guess approach to building applications (and seems great at it!).
The applications I currently have are:
To explain why I have this discovery service I need to mention Spring Cloud. Spring cloud is another new part of the spring family. It integrates a lot of the netflix micro service projects into spring. This includes eureka for discovering any applications within the microservice architecture. Combined with ribbon it also provides the ability to scale any process intensive micro services and have them load balanced automatically.
The discovery service provides a UI with information about the deployed microservices, it also binds a DNS value to the ip of that microservice. The DNS value will usually match the name of the spring microservice, for example "ExamService". There are multiple benefits of this for example a single configuration point for environment specific deployments.
Much like most of the micro services I've written for Exam API the application is built using Spring Boot with JPA entities and repositories. It also uses docker which is built and deployed by CircleCI.
The examination service provides an end point enabling users to submit examinations with a list of questions. The service saves the examination details in mysql with the details needed to identifier that specific exam (exam board, qualification type, subject, module and exam date). Once this is done an examination ID and a list of questions are forwarded to the QA service.
The QA service is another spring boot app. However it differs as it uses elasticsearch to store data in a noSQL format. The reason I have chosen to use elasticsearch is to increase the speed of the textual searches. The data will contain lists of large questions that can be can queried using 'like' queries. For example - find me all exams for AQA GCSE Maths that related to "differentiation".
Some examination questions may contain large images that need to be persisted for future retrieval. Elasticsearch and MySql are not adept at this, so for this issue I decided to look into Google cloud storage. Google cloud storage is very similar to AWS S3 for the amazon fans out there. I decided I'd give Google a go as back when app engine was out I felt their pricing was incredibly generous. The QA service will create a UUID for each image and save it in elasticsearch, the image is then transfered to Google with a filename that matches the UUID. That way when its invoked we can identify which image belongs to each question. If there are multiple images they will be marked with an _#.
Although not necessary Zuul is another spring cloud feature that allows all services to be routed to the same URL. Zuul is known as a reverse proxy. So for example if Zuul is hosted on localhost the urls for my services would be localhost/qaservice, localhost/objectstoreservice. This would help get around some issues such as CORS. However when building a rest service using JSON-LD I'm not sure how the URL's are rewritten. When I find out I'll update this page.
Thanks for reading about my ExamAPI, if anyone is interested feel free to get in touch. If you'd like to see the code it's on my github page