Closed bap2pecs closed 2 months ago
SyncDB and BridgeServer.DB in https://github.com/0xPolygonHermez/zkevm-bridge-service/blob/develop/config/default.go are actually the same thing
SyncDB
BridgeServer.DB
if we look into https://github.com/0xPolygonHermez/zkevm-bridge-service/blob/develop/cmd/run.go, SyncDB is only used once to run migrations and the following lines
apiStorage, err := db.NewStorage(c.BridgeServer.DB)
connects to the DB
there is no other references of SyncDB in the entire codebase
so I'd recommend just keep one of them
Hi, yes. You are right. The idea is let the api to point to a db read replica. All the write operations use the write replica. This allows us to reduce the db load and keep the performance
SyncDB
andBridgeServer.DB
in https://github.com/0xPolygonHermez/zkevm-bridge-service/blob/develop/config/default.go are actually the same thingif we look into https://github.com/0xPolygonHermez/zkevm-bridge-service/blob/develop/cmd/run.go,
SyncDB
is only used once to run migrations and the following linesconnects to the DB
there is no other references of
SyncDB
in the entire codebaseso I'd recommend just keep one of them