I am asking this as I am wondering if it could be efficient to run mapreduce queries over a database or a shared keyvalue store?
For example, to implement a web trawler, which indexes the internet and counts all the terms on different web pages, could this be done efficiently with a database as a backend?
Sure. HBase and other NoSql stores are well suited for this task.
See this article for a general overview of using HBase with MapReduce.