Everyone want to keep Django timezone support but sometimes you need to keep your SQL queries a way from timezone conversion especially if by default your application timezone is UTC. Django will do something like this CONVERT_TZ(`app_incident`.`datetime`, 'UTC', 'UTC'))
and it will return Null
if the timezone table is empty. Even that conversion is not even needed.
Category: MySQL
Django Custom Lookups
By default Django has a date
lookup that support timezones. It actually will wrap your field with CONVERT_TZ
in case USE_TZ
is True
. This is pretty awesome unless you have timezones table empty because this call will return Null.
How To Set Up MySQL Master-Master Database Replication
One of the most difficult tasks for software engineers is scaling out the databases incase of large traffic applications. Today we will discuss one of the horizontal scaling techniques which is the Master-Master replication. Master-Master replication adds speed and redundancy and also distribute the writes load over many servers.
How To Install LAMP Stack on Ubuntu
LAMP stack is a group of open source software and it stands for Linux, Apache, MySQL, and PHP. To install them Just run the following bash script with a non-root user with sudo privileges configured on a server running Ubuntu.
continue reading »
Learning MySQL Aliases
MySQL aliases are simply nicknames used to express tables, columns and functions’ names. These nicknames can be used in your queries to make them short and neat. Let’s explore this feature.
Kick-Starting MySQL
Today MySQL is one of the most popular open source databases as it supports millions of web applications. We will discuss the basics of MySQL like creating databases and tables and interacting with data.
Working With MySQL Unions
MySQL unions used to combine the results of multiple SELECT
statements into one result. MySQL supports both UNION
and UNION ALL
for joining SELECT
results.