Visiting Libraries to Understand Databases
February 2025

Background - I <3 Databases
Before I was a teacher, I spent the first (almost) ten years of my career as a data engineer. I love databases. I get a thrill out of organizing lots of little data points into a collection that I can derive knowledge from, using a declarative language for high-level problem solving, and then peeling back the layers to understand and optimize execution.
So I was thrilled this year when I got the opportunity to transfer to Arlington Tech and teach a high-level elective course called Dual Enrolled Database Design and Management. I have a small class of motivated students, and I've had a blast this year coming up with exciting projects to motivate their studies.
This project came at a turning point in our studies - from database design to management. We spent the first portion of the class learning SQL and data modeling, and we were transitioning into a unit about query execution. I wanted my students to gain an appreciation for the fact that there are a lot of different ways to structure a database and to execute a query, and that the exact way a database works might look very different based on the its constraints.
Algorithms to Live By
To introduce this topic, my students read two chapters from the fantastic book Algorithms to Live By, about sorting and caching. Both chapters are friendly introductions to problems that are relevant to databases and that can be solved via a wide variety of algorithms that are each optimized for different constraints. And more appropriately, both used analogies about libraries to motivate their discussion. One story in the book was about the student workers at a university library who are responsible for reshelving returned books - each worker had devised their own system to complete this tedious task, and many had noted huge improvements when they changed strategies.
After this reading, we had a conversation in class about similarities between a library and a database - both organize a lot of information, and need to make that information easily accessible. We made and discussed an ER diagram for a library database to think about all of the information that a library contains.
Field Trips
Our school is positioned in a great location to study libraries! We were able to take walking field trips during class to visit three different libraries:
- Our school is small and has its own library with a small collection (pictured at the top of this post). It started out as a student project and now has a full-time librarian who is passionate, helpful, and makes the small space feel large
- We share a building with a public library - the Columbia Pike Branch of Arlington Public Library
- Right across the street from our school is the Montessori Public School of Arlington, which has its own library
As a bonus, we:
- Had a zoom call with a librarian from Northern Virginia Community College (as a DE class, my high school students earn college credit through NVCC, so this was a great opportunity to connect them with the college).
- Visited a Little Free Library on a nearby sidewalk
- Checked out the large collections of books that I and a few other teachers keep in our classrooms
- Read about the New York Public Library which came up with a very interesting solution to their space constraints
- Read about an indigenous library in Canada that has developed their own organization system that is culturally relevant for their population
- Read a Reddit thread where librarians discussed different ways to organize their fiction collections
As we visited each of these libraries, we chatted with librarians about the population their library serves, the time/space/budget constraints that they work under, and how they work within those constraints to do the best they can to serve their users. Our takeaway from this phase of our project was that libraries are very diverse. Here are just a few of our observations:
- The elementary school library had the most circulation - young children love to check out lots of books and return them quickly. They had a counter at their desk that said they'd already checked out 20,000 books this school year.
- The public library is one branch of the large Arlington Public Library system. Patrons can return books to any branch that is convenient to them. This creates an interesting effect where the collection at each branch evolves to reflect the interests of its community. And the library system does a lot of cool work to make sure that they maintain a good distribution of books throughout their system.
- My students really enjoyed learning about non-book collections. At the college library, there is a collection of rocks available for geology students to check out.
- Different libraries use different organizational systems. Most libraries use variations of the Dewey Decimal system, but the college library followed the Library of Congress system. The elementary library can't rely on their patrons understanding decimals at all, so they have developed their own easily-understandable browsing system, which includes a a whole section for books about mermaids.
- Keeping a library organized is a ton of work! All of the librarians told us that they had trouble with books getting placed on the wrong shelf, and had to do constant curation to keep track of which books were most popular, which new books needed to be added to the collection, and which books were not being circulated and could be culled.
Recommendations
After these tours, my students (in pairs) each chose a single library to focus on. Their goal was to identify connections between the libraries we visited and the computing problems that we studied, and then to use their knowledge of computing to come up with actionable recommendations for their library. We invited the librarians who we met to our classroom for some presentations and a discussion about the students' recommendations.
Here are a few of the recommendations that students came up with (and links to their full reports):
- At the public library, there is a large back room where recently-returned books wait to get organized and reshelved. Students identified that the books that have been most recently returned are likely to be the books that the next patrons are going to want to find (in computer science we call this temporal locality of reference). The students suggested that the librarians might move that back room out into the open, and invite patrons to browse the books that others have recently returned.
- The elementary school library has a few specific genres that seem to fly off the selves (when we visited, the librarian was surprised that the 'minecraft' section had two books sitting on the shelf - she told us that they both would be checked out very soon). Students suggested that the librarians might want to move those shelves very close to the librarians' desk area, to minimize their work as they reshelve those books frequently (this relates to a CS concept called a cache hierarchy)
- For our school library, students thought about the merits of genrefication (separating specific genres like romance and fantasy out from the general fiction system which organizes books entirely by author's last name), which relates to concepts in databases called bucketing and indexing.
Takeaways
At the end of this project, we went back to the ER diagrams for a library that they had made at the very beginning. We had a great discussion about how straightforward the data model looked when we first thought about it, and then how complex and varied the actual implementation was at each of the libraries we visited.
Students came out of this activity prepared for our unit about query planning, with a strong intuitive understanding that there might be many different ways to organize a dataset and many different strategies to satisfy a single query, that choosing the optimal strategy can make a huge difference for performance, and that doing so depends on a lot of factors.
Thank Yous
As a teacher, my biggest takeaway from this project was that community engagement is incredibly rewarding. I really appreciated all of the librarians who took the time to meet with my class, engage with my students, and passionately share their knowledge and experience with us. I also learned a lot from workshopping this project with the project-based learning coaches at my school, and the many other colleagues I discussed it with. Thank you to everyone who helped!