Big, throwaway tables make dumps slow and large: session stores, access logs, caches. Skipping them entirely is risky, because the app then fails on a missing table after a restore. MariaDB’s dump tool can keep the table and drop only its contents.
mariadb-dump --single-transaction \
--ignore-table-data=appdb.sessions \
--ignore-table-data=appdb.access_log \
appdb > appdb.sql
The docs say --ignore-table-data dumps only the structure of the named table and not its data. You repeat the option once per table, and each table has to be written with both the database and the table name, such as appdb.sessions. After a restore the tables exist and are empty, which is what most apps want for a cache.
It has a stricter sibling, --ignore-table, which leaves out the table completely, definition included. The docs say it can also be used to skip views. Use it only for things you can truly rebuild without.
The caveat is the same as for any selective dump: you are choosing to lose data. Write down which tables you excluded, and be careful with tables that look like logs but carry state, such as a queue of jobs that have not run yet. The docs also remind you that stored procedures and events are not dumped unless you add --routines and --events, which is a separate gap in many backup scripts.
Restore it the normal way, with the client reading the file: mariadb appdb < appdb.sql.
Further reading: MariaDB documentation: mariadb-dump