5 key items that maketh a dangerous Drupal backend developer (in a good way)

man analysing

These are the 5 keys concepts that would make you a very dangerous Drupal backend developer -- in a good way!    

1. Almost everything is a plugin, service, or a class that can be created or replaced.

We can replace all plugins, services, or certain class implementations.  This is usually done via hooks and event subscribers.

If you are already using hook_entity_type_alter|build to alter entity handlers such access control handler, I salute you.  Heck you can even replace the Node class itself if you need to have a generic functionality for all nodes or if you just want to show off.

This alone would make the ladies go wild! =)

2. Understanding Drupal caching layers.

I am talking about Drupal cache bubbling, cache context, max-age, cache tags.  This is an excellent blog https://www.previousnext.com.au/blog/ensuring-drupal-8-block-cache-tags-bubble-up-page article that will helps explain cache bubbling.  

In your views, if you don't set it to "no caching", if you are already using addCacheableDependency to your RedirectResponse, if you are debugging Drupal cache tag in response headers, and if you don't rely on \Drupal::service('page_cache_kill_switch')->trigger() to get the job done -- Dries is smiling with approval.  

3. Mastery over Drupal access control.

I was tasked with to customize search results based on certain roles.  I thought this was impossible (at least for me).  A colleague introduced me to hook_node_access_records and that was a game changer.  This is hook is at the very heart of og and domain module access control.  Learn hook_node_access_records.

Also, if you are used to tracing access issue and can trace back to EntityAccessControlHandler you my friend have good mastery over drupal access.  

4. Database structure and hook update issues.

Take on as many Drupal hook_update_N issues as much as you can.  This will give you much knowledge on Drupal's database structure.

5. Troubleshooting backend performance issues.

Finally, always welcome trouble shooting backend performance issues.  These are the issues that are only happening due to heavy site traffic. 

You will grow and learn a lot and lose a lot of hair along the way.  This is the most disheartening but equally rewarding as well.  There have been seasons in my career that created a lot of stress due to production downtime issues. 

You will be forced to rely on New Relic (https://bryanmanalo.com/how-use-new-relic), understand SQL explain plan (https://bryanmanalo.com/using-sql-explain-plan), database locking and transaction, the importance of configuring the number of workers, and going deeper in Drupal core.

 

Be dangerous!  Take on the difficult issues! 

Comment below if you want me to discuss in more details one of the 5 items.