If you’ve always wanted to see a small-town VIP kiss a pig, here’s your chance: Head to Farmington in mid-June for Farmington Dew Days.

If you’re really into firetrucks, get yourself to the Burnsville Fire Muster in early September for what’s said to be the Upper Midwest’s largest parade of flame-fighting vehicles.

And if you love dachshunds, visit St. Bonifacius in June for Spass-Tagen (German for “fun days”) to cheer from the sidelines at the annual wiener-dog race.

Festivals abound during a Minnesota summer. They celebrate foods ranging from raspberries to ribs, from sweet corn to the traditional Czech fruit-filled pastry kolacky. They honor residents’ roots in Germany, Ireland, Italy, Poland, Africa, the Middle East and, of course, Scandinavia. They celebrate the achievements of railroad tycoon James J. Hill, the defeat of outlaw Jesse James and the adventures of fictional Karl Oskar — protagonist of Vilhelm Moberg’s bestselling 1950s “The Emigrants” novels, who is brought to life in Lindstrom, Minn., with an eponymous celebration in early July.

Every festival is different. But Robert H. Lavenda, a St. Cloud State University anthropologist who has studied Minnesota community festivals for 35 years, is more interested in what they have in common.

“They’re all the same,” said Lavenda, author of “Corn Fests and Water Carnivals: Celebrating Community in Minnesota” (1997). He doesn’t mean they’re indistinguishable, but that they share underlying characteristics — the events they stage, the customs they preserve, the ways they uphold local culture and reinforce social cohesion.

Festivalgoers around the state dance in the street, quaff 3.2 beer, applaud kiddie parades and feast on food provided by the Lions Club, the Women of Today or the hockey boosters. One year, Lavenda kept track: 81.5 percent of community festivals feature a parade, 79.6 percent hold dances, 59.3 percent stage a queen pageant and so on.

Minnesota holds more of these Main Street revelries than most states, as Lavenda has verified with calls to tourist offices around the country.

“Minnesota is quite unusual,” he said. “From Memorial Day to Labor Day, I once counted and there were over 200 small-town festivals in Minnesota.”

Community festivals may seem as old-timey as band shells and Blue Plate Specials, but according to Lavenda most originated in the late 1970s or 1980s as an outgrowth of 1976’s U.S. bicentennial celebrations. They’ve folded in trends over the years — when running became popular, 10K races became a fixture. Events that prove successful in one town get adopted in others.

But certain traditions endure, Lavenda discovered in his explorations. “The festivals I was going to, you couldn’t tell what year it was. It could have been 1981, it could have been 2001, it probably could have been 1971.”

Darla Donnelly is an organizer of Farmington Dew Days (June 14-18), originally named Mountain Dew Days to signify Farmington’s alleged status as the nation’s top consumer of the lime-green pop (the name changed after PepsiCo., the soda’s manufacturer, dropped its sponsorship). She said it’s the only festival she knows of that features a pig getting kissed. (Eww, on the lips? On the snout, city slicker.)

Residents designate the swine smoochers by dropping donations in cans labeled with the names of local luminaries — city officials, merchants, coaches, etc. Whoever raises the most money is obliged to pucker up.

“It’s very entertaining,” Donnelly said.

The Burnsville Fire Muster began as a modest 1980 parade in a shopping center organized by a group of firetruck collectors and grew so large that in 2004 it won a Guinness World Record, with 86 trucks (surpassed, sadly, by Atoka, Okla., with 220 in 2012), though most years the parades are smaller.

Burnsville has a high concentration of firetruck enthusiasts, although according to festival chairman Tom Taylor, the connection with the city’s name is purely coincidental. The word “muster” is a reference to early firefighting methods: “If you were going to put a fire out, you’d muster up support,” Taylor said.

Festivals serve as a reminder of a town’s substance and collective identity, Lavenda said. Extended families schedule visits around them, graduates look forward to reconnecting with former classmates, and longtime residents remember why they like living there.

“The main idea behind it is to get people in the community out to meet their neighbors, socialize, have a fun place where the kids can play,” said Pat Gorman, vice president of St. Bonifacius’ Spass-Tagen (coming June 25).

Even people who fled town practically the day after high school graduation enjoy returning for an annual dose of nostalgia. In an era when technological and cultural change can feel overwhelming, community festivals offer a solid and comforting sense of continuity.

“Some people claim they hate the local festival,” Lavenda said. “But then you see them serving beer there on Saturday night.”