Database controller