<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_backend(database):
 """ Configure used database, so sqlpuzzle can generate queries which are needed. For now there is only support of MySQL and PostgreSQL. """

    new_backend = BACKENDS.get(database.lower())
    if not new_backend:
        raise Exception('Backend {} is not supported.'.format(database))
    global BACKEND  # pylint: disable=global-statement
    BACKEND = new_backend