OpenLampTech No. 132
Database Transactions in Laravel | SQL Antipatterns | WordPress hooks resource | EAV design | Drupal Field Defaults Module | Open-source databases
Thank you for reading the OpenLampTech newsletter!
If someone awesome shared this newsletter with you and you are not yet subscribed, please use the Subscribe button below and join:
OpenLampTech has sponsorship opportunities for your brand, product, or service in the weekly newsletter. As an independent publication, collaboration is very affordable.
All commentary and opinions are mine unless otherwise quoted.
The Enigmatic Power of Entity-Attribute-Value (EAV)
EAV is a (prominent?) database design pattern in which attributes are stored in separate tables from the main entity/data point.
With all of the storage advantages that EAV brings, queries for data retrieval are complex and can be non-performant, oftentimes requiring many JOIN
s.
The attributes table is more of a catch-all type of table therefore enforcing data integrity through types is not possible.
Although EAV is a popular choice, it should likely be used for specific use cases only.
[Medium]
Save Time, Maintain Consistency: Bulk-Update Drupal Content Instantly with the Field Defaults Module
Consistency across your website builds brand awareness, trust, and an overall appealing visual aesthetic. The Fields Defaults Module allows you to bulk-update content on your Drupal site.
Any Drupal entity that has fields can be updated using Fields Default Module. This can include articles, user accounts, and custom blocks to name just a few.
In my opinion, one useful feature of this module is you can add new fields with values as well.
[Imagex]
Using Database Transactions to Write Safer Laravel Code
Database transactions provide us as developers a sort of “safety net" when working with data via UPDATE
, DELETE
, and other Data Manipulation Language (DML) commands. Transactions operate as a whole unit of work. An “all or nothing” type of workflow with the ability to ROLLBACK
or undo database changes in certain situations.
Laraval supports database transactions with dedicated classes and methods. Ash Allen covers using database transactions in Laravel, providing details and code examples.
[Ash Allen Design]
Book Recommendation - SQL Antipatterns
I'm tooting my own horn by sharing this older article first published in OpenLampTech's infancy.
One thing (of many) this particular book gets right is “thinking in SQL”. When I say that I mean, using (often overlooked) aspects of SQL as they can - and should be - used.
SQL and databases have many features built right in that will help developers with their applications.
SQL Antipatterns: Avoiding the Pitfalls of Database Programming is one of the few programming-related books that I have both a digital and print copy of.
Yeah, it's that good.
Add it to your collection and visit the concepts. You'll be glad you did.
[OpenLampTech]
Old is New Again: The Primacy of Open Source Databases
Open-source databases such as MySQL, MariaDB, and PostgreSQL are the backbone of many applications and websites. Not only does the budget-friendly cost (free) of these critical pieces of software appeal to their user base but so too does the freedom that comes with choosing open-source. Just because open-source databases are free, you can still operate mission-critical products and services using them.
WooCommerce News and Updates
Developer Advisory: HTML Tag Update in Block Templates for WooCommerce 9.0
WordPress Hooks (Looks like a handy resource)
WooCommerce 8.9.1: Dot release
WooCommerce 9.0: Pre-release updates
[#Affiliates and Classifieds] - Your support keeps the OpenLampTech newsletter free for readers
Take your Laravel applications to the next level with Battle Ready Laravel by Ash Allen. Learn how to improve the performance, maintainability, and security of your Laravel projects in this e-book. (affiliate)
Ultimate Laravel Boilerplate to help other indie hackers deliver their SaaS in hours. Get started with LaraFast today! (affiliate)
Popups, newsletters, and abandoned carts. Use Omnisend with integrated email and SMS campaigns. (affiliate)
Thank you for reading. I hope you have a great rest of your week.
Take care.
Josh Otwell
OpenLampTech is a reader-supported publication. You can support the publication with a virtual coffee for as little as $3 (USD).
Some links may be affiliate links from which I earn a small commission at no additional cost to you.