Django Easystart - The Modern Monolith

In recent years, there has been a trend in the software development world where all companies and startups began migrating their systems to a microservices-based architecture, which has many advantages oriented towards increasing team agility. However, using microservices without a strong design reason is a double-edged sword. While this may work in companies with thousands of employees and infinite funding, such as Amazon, Google, Facebook, Netflix, most projects do not require this type of scale.

Successful companies like Segment that migrated to microservices at some point in the history of their products have been forced to return to monolithic structures due to the operational complexity that this brings with it. To read more about this case:

What are Microservices? + How to Consolidate & Scale Them

Similarly, we have the case of Shopify, one of the most famous e-commerce sites in the world. Shopify is built based on a monolithic structure written in Ruby on Rails, which has allowed them to process $100 million in sales per hour during their peak during Black Friday 2020.

https://twitter.com/tobi/status/1464582718361149450

We believe that dividing the logic of our source code into thousands of independent services is not the answer; this generates more failure points and more headaches for the team and introduces more complexity and security gaps. These factors detract from our Technical Values.

For this reason, at Django Easystart, we have decided to use a monolithic architecture in our products, which we carry out using the Django framework, one of the most important frameworks for the Python programming language. We believe that modern software development is already complex and changing enough. Having a modular codebase where each module has a defined responsibility makes us more agile and allows us to deliver value continuously to our clients.

To read more about the monolithic architecture, see the following links:

The Majestic Monolith

Embrace the monolith! | monolithic.dev

However, a monolithic framework like Django is strongly integrated with the backend and frontend, limiting the use of all the functionalities that modern Javascript frameworks like VueJS can offer. To address this, we have integrated InertiaJS into the Django architecture, which serves as a connector between both technologies, allowing us to take full advantage of a powerful monolithic backend and a frontend for Single-page applications (SPA). To read more about InertiaJS go to the official website https://inertiajs.com/.

Architecture Diagram

The following high-level diagram shows the components that make up the software architecture and how these elements interact with each other:

../_images/Easystart-arch.png
  • Backend: Consists of a Python application made with the Django Framework, configured with an inertiaJS middleware that allows us to render JSON views and components. This configuration allows us to use all the benefits of the framework such as authentication, internationalization, localization, among others.

  • Frontend: Comprised of the InertiaJS + VueJS duo, this allows us to develop on the frontend in a natural way as we would with an SPA, but rendering components directly from the Django backend 🤯; This configuration helps us improve the development process since we can use all the modern Javascript tooling such as Webpack, NPM, ESLint, among others.

  • Datastorage: The default database we use in all company projects is PostgresSQL. In the local environment, it is usually a standalone database in a Docker container, but in production environments, we always use a high availability cluster.

  • Async Backend: This allows us to execute asynchronous tasks in the background and periodically, so that our application runs more smoothly and without long waits for the end-user. It consists of Celery and Redis (In production, we switch Redis for RabbitMQ).