Databases are conceptually simple. It's making them go fast reliably that's hard. Naive databases are "Lock everything, take search criterion, run over all records, return result, unlock." (DBASE II in the DOS era actually worked that way, and that's what people using Excel as a database are doing.) Now make it go fast and make it reliable despite failures while updating.
Most of complex algorithms and data structures are used in databases.