Create a guide on database design and management for web applications. Discuss the difference between relational databases (MySQL, PostgreSQL) and NoSQL databases (MongoDB), and best practices for structuring data, performing queries, and optimizing performance.