Nothing ground breaking, but hey, simplicity and basics are the most important.
Reader Rules
Don’t run select *
queries without filters
You might not know how big the table you are querying is. Therefore, in order not to negatively impact the performance of the whole system, limit the amount of the query.
Instead of
|
|
use
|
|
Writer Rules
Use transactions
Even simple & tested queries might have unintentional side-effects.
Any unintended change might lead to a complicated rollback
and a lot more complications.
Instead of running single queries, create SQL blocks which are part of a transaction.
|
|
These changes won’t yet be commited. You will see the output, number of affected rows as well as preview the changes.
If everything went okay and no error was thrown, you can commit these changes:
|
|
If, on the other hand, you want to rollback the action:
|
|
Transactions come with many benefits, but one thing to look out for is not to leave a transaction open for too long (such as starting a transaction and going on a break). The longer the transaction is open, the more negative impact it may have.
Owner Rules
Back-up
Back-up, Back-up, Back-up.
Oh, and Back-up.