Web applications have become a necessity to many people around the world with many uses including work and personal.
As web applications and hardware become more advanced, user expectations also change too. From speed and fluency to security, these expectations can “Make or break an applications success”. Luckily for web application developers, there have been helpful updates and creations to help them fulfil and exceed these expectations.
Netflix decided to take a major lead in creating fast and reliable Web Applications by creating their own solution based on the top of Spring Boot with Spring Cloud. An MVC framework created to allow the creation or Web Applications with Micro services, Spring Cloud is a framework that provides many tools to allow you to create a fast and secure web application.
A Micro service Architecture, consists of individual services which possess a specific role. For example in a social media platform you may have a specific set of services to handle Authentication. An example of this would be an Authentication server for OAuth. This would be accompanied by another service to handle the creation of a user in a Database. One of the many benefits of this is to allow the removal and addition of a replacement or altered service whilst causing little disturbance to the overall application. A good example of this is creating some form of payment service. If a change to payment provider is required, then you can simply “unplug” and “Plug in” the new service.
Spring Cloud offers extremely useful tools to help you achieve this, the most important being “Eureka”. Eureka is a service locator which acts as a clocking in machine for the services. Once a service is initialised or loaded, it reports to Eureka and informs it or its location and name. Spring cloud offers another accompanying tool called “Zuul”, this is a Gateway service which accepts RESTful requests. Zuul will take the request and query Eureka to find the location of the target service. From this query it will then be able to continue the request to the target Service. If the target service is for some reason missing, Zuul handles this in its response therefore keeping the application running with only some features missing.
Think of the general format of a monolithic Web Application, it may include a front-end (Website), a service layer and a Database. For someone who would like to access this database there is the front-end, then once through to the service layer they can gain the Database details.
In a Micro Service architecture you have the ability to add many layers, you also have the ability to externalise the configuration to a private repository somewhere such as GitHub. This is achieved by using the Config Service also provided by Spring Cloud. When a service initialises, it contacts the Config service to request that it locates the configuration values it requires to perform. The Config service then locates these values from your private repository. This service can have access restricted in your cloud architecture so that it is buried deep. Essentially you are forcing access credentials to spread out and externalise with added security access in place. You also have the ability to split the Database if you are using a Non-Relational style database. Which would mean someone with malicious intent would not be able to access the whole data.
Docker is a fantastic tool used to create services and also allow for speedy deployments. By creating individual containers to run the Java application for the service, you have a working environment which can be taken, shared or deployed. In my experience using tools such as Amazon ECS to deploy your containers is extremely beneficial and allows for not only added security and availability, but adds version control of a full service. It also means you have access to control the individual services as a collective and monitor the performance as well as the availability of the application. Not just all of this but these tools also offer Auto-Scalability to handle performance under stress. Without much physical maintaining this can be achieved as many services such as ECS offer this all automatically once you configure the rules. Docker images can be created as part of a Java build cycle using Maven etc. Or as part of your build process. In experience “com.spotify” has a Docker plugin adds a great facility to manage your Docker build as part of the build cycle.
A Micro Service Architecture is as cost effective as you make it. Many services can generally be run at low hardware requirements but as a collective it may match that of a monolithic application. The benefit is that you can adjust it depending on load easily with scaling of the specific services or collective to reduce the hardware requirements and allow the auto scale to handle the rules you place to set limits and minimum requirements. Also there is very little outage time as many tools allow for High Availability which includes relaunching a service or service once it has failed.
For many organisations and tools the added benefits of security, speed, availability and scalability can offer much needed requirements which fulfil the expectations of an advancing user-base, whilst adding future-proofing to a variety or performance and security risks. All for similar costs and potentially reduced maintenance.
By Steven Skedge www.stevenskedge.co.uk