Chapter 6. Deploy Real Applications on Swarm

With a Swarm infrastructure we can put up various types of load to deploy. We'll work on the application stack in this and the next chapter. In this chapter we'll:

  • Discover Swarm's services and tasks
  • Deploy Nginx containers
  • Deploy a complete WordPress
  • Deploy a tiny scale Apache Spark architecture.

Microservices

The IT industry has always been keen on decoupling and reusing its creations, either source code or applications. Modeling applications at the architectural level is not an exception. Modularization was earlier called service-oriented architecture (SOA) and was kept glued by open source protocols based on XML. However, with the advent of containers, everyone is now speaking of micro services.

Micro services are small and self-contained autonomous modules that work together to accomplish an architectural goal.

The most inflated example of a micro service architecture is a web-application stack, for example WordPress, where web server might be one service, others being the database, cache engine, and the service containing the application itself. Modeling micro services through Docker containers can be done immediately and that's how the industry is moving ahead right now. 

Microservices

There are many advantages of using microservices and they are as follows:

  • Reusability: You just pull the images of services you want (nginx, MySQL) in case you customize them
  • Heterogeneity: You link existing modules embracing the different technologies. If, sometime later in the future, you decide to switch from MySQL to MariaDB, you plug off MySQL and plug in MariaDB
  • Focus on small: Detached modules are easy to troubleshoot separately
  • Scale: You can easily scale the web servers to 10 front ends, the cache servers to three, and architect the database replicas on five nodes, and one day scale-up or scale-down depending on the application load and needs
  • Resilience: If you have three memcached servers and one fails, you can have mechanisms that try to resurrect it or just forget it and immediately fire up another one
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset