I thought I could spend ages faffing around with a drawing package, or I could do the kind of diagram we do at work.
At the top here, we have Jenkins. Underneath are the various projects, 0 to n, obviously, and each project holds onto its own builds, again an inderminate number of them. There are other things here too, views for instance have pointers to the projects they show, there might be some slave information, but that's kind of secondary. Everything is more or less always in memory - each project doesn't have all the details of every single build in memory all the time, obviously, that would be silly, but it's essentially transparent. They're there when you need them, and quietly disappear when you don't.
So, where does it get it from when it needs it?
Jenkins persists everything to disk. It doesn't use a database for a number of reasons. It would make things more complicated to install, say. It would probably make plugin development more awkward - databases don't lend themselves to extensibility. Doesn't really need transactions. So it persists everything out to disk as XML, using a library called XStream. XStream may no longer be the cutting edge of Java persistence libraries (I don't know), but it works, and it's extremely hackable. It also tells you more about what's going on inside those projects.
If you poke around in your Jenkins work directory, you'll find all kinds of interesting stuff in the various XML files there. I would urge you to have a look. Here's our sample project that we created a little earlier.