Database for tree structured data