How do I share Rails Monolith

manage it

Amazon, Ebay and Netflix are good examples of successful large companies that have long been using applications with microservices architectures. They are the developers' not-so-secret weapons that help businesses stay fast, reliable, and efficient. Compared to monolithic architectures, microservices are more agile and therefore more efficient and behave like a school of fish in relation to an ocean liner.

display

Monolithic applications are still very common in today's business operations. They are created in conventional development environments, are easy to develop, test and - at least initially - easy to implement and scale. There is only one catch: such a monolith gets bigger and more complex until it finally becomes a complicated code monster. This is a challenge for organizations that have to react flexibly to constantly changing business requirements and customer requests.

display

There are situations where monoliths are definitely an advantage.

This concept is favored especially in the early days of application development because it is known and therefore established. With monoliths, the business logic is at the core of their application, they are implemented by modules for the individual services, objects and events. This core is then surrounded by databases and components for messages as well as the web connection implemented by an API or a user interface and connected to the outside world.

Even if such applications were designed in a modular way, they are implemented as a monolith. Good examples of this are Java applications that are implemented on application servers and packaged as WAR files or as stand-alone and executable JAR files, or Rails and Node.js applications packaged as a directory hierarchy.

display

At the beginning of a project, this model has many advantages. However, as the applications grow and new features are added, everything becomes more complex and cumbersome over time. The more successful an application is, the more difficult it usually becomes to use it because, in addition to the original information, it consists of many lines of source text that are gradually added.

If, over time, the problems come

By then, at the latest, continuous provision is no longer possible: The monolith must be broken down into smaller parts. Regression testing can take a tremendous amount of time on a large monolith, especially if special requirements for manual testing of the user interface are expected. For developers, the work becomes very difficult, if not almost impossible, especially for those who are not familiar with the application. The time required to fix errors and remove vulnerabilities then grows exponentially - not to mention the time required to implement new functions.

That alone is difficult enough - but companies today also have to respond efficiently to new customer requests and changing market conditions. If even small changes to a business-critical application amount to turning an ocean liner around, then the competitiveness of a company is significantly reduced.

Monolithic applications are a significant barrier to innovation and success.

Difficulties in scalability can severely limit a company's flexibility to respond to increasing demand. For example, integrating new languages ​​and technologies can be a major challenge. Since DevOps, microservices and containers are very common applications today, monoliths also make it difficult to recruit new developers who usually want to work with the most modern technologies.

Microservices as a solution

So what to do The big ones show how it is done. They use microservices models in which the applications are broken down into a small set of interconnected services depending on the operational capabilities. Each service implements a group of different functions and thus serves as a mini-application with its own application logic, its own adapters and even a database schema. Such services can then be combined in various ways and serve as a whole as a new product.

For Martin Fowler, American author, software developer and early advocate of microservices, the microservices model is »an approach to developing an overall application as a group of small services, each running as a separate process and using simple mechanisms, often HTTP based APIs, communicate with each other. «These services should be adapted to the operational possibilities and implemented independently of each other by a fully automatic implementation process, so his opinion. After all, there is only a minimum of centralized management for these services, which are written in different programming languages ​​and can use different data storage mechanisms.

When, if not now?

The idea of ​​microservices is far from new, but the concept is more important than ever in today's dynamically changing business environment. Each service has clearly defined boundaries and communicates with other services via some kind of API. The model enforces a degree of modularity with which the individual services can be developed, tested and implemented more quickly. The additional benefit for developers: These services are much easier to understand and maintain.

The microservices model also makes it easier for development teams to focus on one service at a time rather than on a whole, monolithic application. So developers are not limited by the technologies used for the original monolith. Rather, they can choose the most suitable technology for the task at hand and proceed step by step. Each service also has its own database scheme. Even if this contradicts the principle of a company-wide data model, it still allows developers to use the database system that best suits the respective service. This is also known as "polyglot persistence architecture", that is, an architecture of polyglot persistence.

Taming the data monster

With the microservices model, a company's data monster can be tamed, provided three important steps are implemented:

  • Act now! If a new function is to be implemented, the new code should be implemented as an independent microservice instead of creating it again for the monolith.
  • Separation is a must! In most monolithic applications, there is a clear separation between the external presentation (user interface / front end) on the one hand and internal, company-side data access on the other (back end). Both are usually connected via an API interface. Dividing the application along this interface results in two smaller applications.
  • Step by step: modules become independent microservices. Each time a module is detached and converted into a service, the monolith becomes smaller. As soon as enough modules have been converted into microservices, the monolith is no longer a problem.

Microservices aren't perfect, of course, and they're not a panacea for any organization's concerns about their applications. However, they can very well help companies better match business and information technology needs.

Chris Stetson, Chief Architect of Microservices Engineering at NGINX

 


 

Here is a selection of specialist articles, studies, stories and statistics that fit this topic. Enter your search terms in the »Article search ...« top right and you will be surprised which other hits you will find on our website.

Medium-sized companies are too indecisive when it comes to microservices and containers

Optimal use of knowledge and information - The 5 factors of successful technology development

CIOs need an event-centric strategy for digital business

Five characteristics of future-proof cloud architectures

Future, digitization and success: 69 percent of the SMEs surveyed have a positive outlook on the future

Bimodal IT: Five steps on the way to future-proof IT

Application integration forecast in 2017

Other articles on CodeDevOpsBusiness operationsRestructuringContainerArchitecturesMicroservicesmonolithic architectureDevelopment environmentsMonolith