The USDB Syncer is a tool designed to synchronize data between different databases or systems. The purpose of this report is to provide an overview of the USDB Syncer, its functionality, and its benefits.
[3] D. Abadi, "Consistency Trade-Offs in Distributed Systems," in Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data, 2015, pp. 163-168. usdb_syncer
[ Blockchain Node (RPC) ] ←→ [ Syncer Core ] ←→ [ Off-chain DB ] ↑ ↓ ↑ └───── Event Stream ─────────┘ │ │ [ Transaction Builder ] ←─────── Off-chain Logic ─────┘ The USDB Syncer is a tool designed to
USDB Syncer is implemented using a combination of Java, Python, and SQL. The CDC module uses Java to capture changes from the master database, while the log file module uses Python to maintain the log file. The API module uses RESTful APIs to communicate with the slave databases. The CDC module uses Java to capture changes
The tool supports various databases, including MySQL, PostgreSQL, Oracle, and Microsoft SQL Server. It also supports multiple operating systems, including Windows, Linux, and macOS.
def sync_range(self, from_block, to_block): events = self.contract.events.Transfer.get_logs( fromBlock=from_block, toBlock=to_block ) for ev in events: self.apply_transfer( from_addr=ev['args']['from'], to_addr=ev['args']['to'], value=ev['args']['value'], tx_hash=ev['transactionHash'].hex(), block=ev['blockNumber'] ) # Update checkpoint after successful persistence self.db.set_checkpoint(to_block)