DATABASE IMPLEMENTATION