This book is an introduction to finite model theory which stresses the computer science origins of the area. In addition to presenting the main techniques for analyzing logics over finite models, the book deals extensively with applications in databases, complexity theory, and formal languages, as well as other branches of computer science. It covers Ehrenfeucht-Fraïssé games, locality-based techniques, complexity analysis of logics, including the basics of descriptive complexity, second-order logic and its fragments, connections with finite automata, fixed point logics, finite variable logics, zero-one laws, and embedded finite models, and gives a brief tour of recently discovered applications of finite model theory.