We begin with Daemon plugins as an introduction to the new MySQL Plugin API due to their simplicity. Plugin API is designed to facilitate the adding of extra code to MySQL without having to recompile the entire server. A typical use of a Daemon plugin would be to create threads to execute some background code. This gives us a basic structure to start with which can be followed later with other plugin types.
In this chapter we will cover the basic information needed to write a Daemon plugin and use some examples to illustrate how this could be applied in practical usage. Background knowledge of POSIX threads is useful for this chapter, but we will go through things simply and explain what is going on at every step.