You could use a database, but that isn't optimal and not what a database is designed for.
Peer to peer also isn't optimal, because every server will have to keep a connection open to every other server, which is wasteful.
Best thing to do would be to have a centralized server to which all your servers connect & to design your own protocol to communicate between game server and your central server. One of the most useful advantages over using a plain db is that you can shove heavy calculations or i/o bound operations to this server, keeping your game server lag-free. Another advantage is that you also tighten the gaping security hole an open database connection on the game server is (for larger communities especially).
I like to use websockets and then communicate using JSON encoded strings, JSON & websockets (especially with modern libraries) take a lot of low-level work out of regular sockets and are supported virtually everywhere.
Personally I have this implemented using Django + Daphne on a web server and
websocket-client with SourcePython on the game server.