Craft uses a fairly typical relational model, where most1 custom fields have a single column in the content table, set to an appropriate column type chosen by the field type. Unlike EAV, which crams all data into a fixed schema, Craft’s schema will change over time based on the custom fields you’ve configured.
There are both performance and storage benefits ...
You're not misunderstanding anything, and your concerns are perfectly valid. I feel like many developers using Craft do not realise that .one() and .all() are in fact database calls, and pretty expensive ones at that. Do it your way, watch the number of DB queries go down in the debug toolbar and feel all warm and fuzzy. (Also, you don't need parentheses in ...
It looks like Craft is trying to delete a database field that has already been removed. I have no idea how you ended up in this situation but here's what I'd try to resolve the issue:
first backup your database, in case something goes wrong!
then execute the following command on your server, in the project directory. After each command, try removing you ...
After deleting the users from the UI they are only soft-deleted. If you look at the user id and find the matching element in your elements table, you will see that this element has a populated dateDeleted.
Run garbage collection (./craft gc) to clean up and completely remove everything.
You could also use your general config file to set the softDeleteDuration to a very low value, so that soft deleted elements get garbagecollected quickly:
'softDeleteDuration' => 300, // 5 Mins
or if you're up to the command line, use
./craft gc --delete-all-trashed
to immediately hard delete all soft deleted items
Is there a Craft recommended approach to this issue please?
The simplest solution would be to update to Craft 3.5+
Template cache data went from being stored in the database to the file system, so this won't be an issue for you anymore.
"Personally I'd just use the 'select all' checkbox at the top of entries and delete them all at once."
That's what I've been doing - deleting all entries in the system. I've always thought that by deleting entries in the system it would clean the database.
But when looking in the database there is so much information that is still saved even though ...
The database backup from Craft is slightly different to the SQL export in phpMyAdmin. Craft’s export (presumably) assumes you’re going to want to import that data into an existing site, whereas phpMyAdmin’s default (presumably) assumes you’ll want to import it into an empty database.
However you can do exactly as you suggest — export from phpMyAdmin locally, ...
I'm not sure why you would do two different servers.
Your front end can be cached with Blitz / NGINX which will take a load off the server and admin.
How often are you aggregating the data?
I've just imported 10k records from a source and I would recommend writing your own module to handle the imports as commands. From there you could set up a cron which ...
I'll answer this for the benefit of anyone else attempting the same thing i.e. sizeable Craft 2 to 3 migration, while you still have the Craft 2 site live.
Ultimately, I chose content migrations and chose to basically ignore the projectConfig functionality for the most part during development. Since I originally asked the question projectConfig changed a bit ...
This happens when you go from old craft versions, in the latest versions you have to have the config/db.php file like this:
'dsn' => App::env('DB_DSN') ?: null,
'driver' => App::env('DB_DRIVER'),
'server' => App::env('DB_SERVER'),
'port' => App::env('DB_PORT'),
'database' => App::...