do duty as vs fulfill the function of

do duty as

fulfill the function of

How often have the words do duty as and fulfill the function of occurred in a corpus of books? (source: Google Ngram Viewer )