Scaling Databases

As your app starts growing, one of the first things to feel the heat is your database. Queries slow down, reports get delayed, and your users start noticing. That’s when you start hearing scary words like replication, sharding, horizontal scaling… 😵‍💫 Don’t worry — scaling a database isn’t black magic. In fact, it’s a lot more manageable when you understand the core concepts. So, let’s break it down — one question at a time....

June 16, 2025 · 5 min · 923 words · PandaC

Export all data from a MySQL/MariaDB database to CSV files

Bash script to export all data from a MySQL/MariaDB database to CSV files: #!/bin/bash DB_USER="your_username" DB_PASS="your_password" DB_NAME="your_database" TABLES=$(mysql -u$DB_USER -p$DB_PASS -e "USE $DB_NAME; SHOW TABLES;" | grep -v "Tables_in") for TABLE in $TABLES; do mysql -u$DB_USER -p$DB_PASS -e "USE $DB_NAME; SELECT * FROM $TABLE;" | sed 's/\t/","/g;s/^/"/;s/$/"/' > "$TABLE.csv" done echo "CSV export complete!" Replace your_username, your_password, and your_database with your actual database credentials and database name. Save the script to a file, make it executable with chmod +x scriptname....

August 9, 2023 · 1 min · 109 words · PandaC