Lwin Maung Maung

My Notes and Blogs

Home Laravel Linux

Drupal and Vagrant - not the best match

Published on  Apr 26th, 2024Updated:  Jun 19th, 2024
3 mins Read

Drupal and Vagrant are not the best match for your development environment. It can also ruin your device unless you care how the system is working each other.

I like Drupal over WordPress due to its flexibility, and Drupal is a lot more developer-friendly for later times. I can use package managers such as Composer for PHP. Drupal is easy to work with it. I don't mean WordPress is not good, but it is your preference to choose between WordPress and Drupal.

I am a Laravel developer. I like using Homestead for my projects. Homestead is on Vagrant and VirtualBox. To the people who are not familiar with VirtualBox, it is a virtualization platform. Vagrant is an orchestration tool with a Virtualization Platform so people can run the apps without installing the base or setting it up.

Homestead is on Vagrant and Virtualbox, and it supports Laravel. Many Laravel developers use it, including me. I use it both for developing Laravel projects and working with other platforms such as Drupal and WordPress.

The main problem I have to address is Homestead is a bit slower than Valet and Laravel Herd due to its architecture. The files are in the host machine, and PHP engines load them via NFS in the Virtual Machine. The result displays the output in the host machine via a private network. This process makes the projects a bit slower than native engines.

Why do developers use Homestead instead of other development tools? The answer is freedom. We have a Linux virtual environment where we can install everything for our needs. We can install new libraries, new tools and even native works.

Long to be short, Homestead is not for Drupal.

Drupal Architecture in a nutshell!

Drupal has caches to make the website faster. Mostly, a web app has three phases. They are presentation, logic and database. The database fetches the data, processes it in the logical layer and presents it in the presentation layer.

The ordinary approach will cost a lot of computing power because it has to run for a set of calls per visit. The pages which will send thousands of copies to the public have only one need. Process once, cache everywhere. When the user visits the same page until it updates, the cache will work before it generates. It saves a lot of page speed and processing power.

The cache is mostly in many files. If you clear the cache, wipe them. The next visit will process everything and cache it automatically.

It works until the host crashes for a lot of reads and writes.

I don't know the details, but it crashes multiple times, leaving the database unusable. Its slowness makes me mad.

Laravel Herd is the lifesaver of my system. It has a lot of tools built in, and it has only a host system. I don't have to do virtualization, boot the machine, etc. It saves my life.

This experience makes me know one thing. You should not use virtualization if you want to cache an enormous amount of data on a disk.

© lwinmaungmaung MMXXIII. All Rights Reserved.