Currently, the incidence of diabetes mellitus is increasing rapidly, particularly in China, and its pathogenesis is still unclear. The goal of this study was to find meaningful biomarkers of metastasis in patients with diabetes and cancer using bioinformatic analysis in order to predict gene expression and prognostic importance for survival. We used the Differentially Expressed Gene, Database for Annotation Visualization and Integrated Discovery, and Gene Set Enrichment Analyses databases, as well as several bioinformatics tools, to explore the key genes in diabetes. Based on the above database, we ended up with 10 hub genes (FOS, ATF3, JUN, EGR1, FOSB, JUNB, BTG2, EGR2, ZFP36, and NR4A2). A discussion of the 10 critical genes, with extensive literature mentioned to validate the association between the 10 key genes and patients with diabetes and cancer, to demonstrate the importance of gene expression and survival prognosis. This study identifies several biomarkers associated with diabetes and cancer development and metastasis that may provide novel therapeutic targets for diabetes combined with cancer patients.