Realtime P2P Database over LAN network

That isn’t necessary, and it has scaling problems because you’re bottlenecked by the performance of the node acting as the server. The server also acts as a single point of failure.

The replication protocol is “multi-master”, which means that any node can act as client and/or server. For example you could have each peer replicating with each other peer and it would still work; it’s just that it would use a lot more local and network resources than necessary due to redundant change notifications. The minimal topology is a spanning tree, i.e. a tree that connects all the nodes, but it can help to have some redundant connections (cycles) to improve latency. You can look into the topic of Mesh Networking to find more information (but it’s a deep dive!)

What kind of scale are you thinking of? There’s a big difference between connecting 5 devices and connecting 100.