Database model implementation.