A Functional Approach to Scientific Database Implementation