Steamboat Days for Winona, MN, was last weekend. This takes over most of downtown Winona, with streets blocked off for rides like a merry-go-round or ones with names like Zipper and Orbiter. There were food booths and booths with games of chance as well as a car show. At the lake there was a children's fishing contest, a kiddie parade and boat racing. Sunday had the big parade and fireworks later in the evening closed the celebration. (more pictures here, if anyone is interested).
Small towns in the Midwest often have a 'Day' (or Days) during the summer or fall. Winona's used to be over the Fourth of July weekend, but there was competition with festivities in nearby towns, so the date was changed. It's a good way to celebrate as a community. The state or county fairs are bigger get-togethers, and that's where the more rural side is often honored, with livestock and agriculture competitions.
Whether it's a town fair, a carnival, state fair, Renaissance festival, amusement park or circus, the setting provides a place where people meet and gather together, try different foods, experience rides that make them dizzy or nauseous, and win prizes (or not). There are also celebrity elements, from beauty pageant winners down to marching in the band. All of these festivals have some descriptions in common: the sights - crowds, flashing lights, bright colors; the noise - music and loud sounds of the various rides as well as crowds of people talking; the smells - cotton candy, popcorn, hot dogs and various fried things as well as unsavory smells.
Town fairs and carnivals are good backdrops for a story. Romance at a summer carnival used to be a popular theme of YAs at one time. Ray Bradbury's Something Wicked This Way Comes and The Circus of Dr. Lao by Charles Finney are examples of fantasy/horror. On television, Phineas and Ferb's town of Danville has already had a Meatloaf Festival as well as a Midsummer Festival and a street fair. It's interesting to explore the festivals from the townspeople's point of view, though the carnival people's perspective can also captivate readers. Gillian Summers has a series (Faire Folk) set at Renaissance festivals but with elves.
Renaissance festivals are good examples of what this type of celebration could look like in a fantasy story (though one would want to do some research to avoid irritating more knowledgeable readers). Gloria Oliver has s well-depicted festival in her Cross-Eyed Dragon Troubles.
For science fiction or futuristic examples, Circus Galacticus by Deva Fagan starts off on present-day Earth, but when her main character runs off to join the circus, she finds herself travelling to the stars. Barry Longyear's Circus World is a collection of short stories of a planet whose population consists of the descendants from a crashed circus ship.
Carnivals can work for all genre - horror, fantasy, romance, mystery, thriller and even science fiction. What are some of your favorite books with a carnival?