-
Notifications
You must be signed in to change notification settings - Fork 0
ADR‐001: Custom SQL Tables vs Custom Post Types
BODAPATI LAKSHMI KANTH VAMSI edited this page Jan 28, 2026
·
1 revision
For the Enterprise Audit Logger, we needed a way to store potentially millions of activity logs (user logins, updates, etc.). The default WordPress way is to use "Custom Post Types" (stored in wp_posts), but this scales poorly.
We decided to implement a Custom Database Table (wp_rt_audit_logs) using the dbDelta() function.
-
Performance: Queries are 10x faster because we are not scanning the massive
wp_poststable. -
Scalability: We can index specific columns (like
user_idorip_address) for faster lookups. - Data Integrity: Keeps historical log data separate from website content.
Accepted and Implemented.
Status: Active Maintenance | License: GPL-2.0 | Author: Vamsi Bodapati