Courtesy of Henning Westerholt, SIP router repository includes dedicated module and applications for fast number portability handling.
pdb server
This server loads serialized routing data from the disk and stores it in memory. It then listens on an UDP port for requests containing a number and returns ID of the carrier which owns the number. This server uses the same datastructure as the carrierroute module and provides a really good performance — consumes only a few percent CPU, even you use only one server for your complete call routing cluster.
pdb connector module
This module connects the sip-router server to the pdb server. It supports load-balancing and aggressive timeouts. Normally it does not need more than a few ms to query the remote server and return the reply to the configuration script.
pdb tool (data compiler)
This tool provides the functionality to compile the carrier and number informations into the binary data format the pdb server expect. It supports optimizing the generated trie structure, so that for example the complete number to carrier mapping for Germany (app. 150 million numbers) don’t need more than a few hundred megabytes. You can also combine not interesting carriers in order to save even more space and get better performance.
The module can be in the modules/pdb directory, the server and tool is in utils/pdbt. This directory also contains documentation (README for module, utils/pdbt/docs/* for data format and network protocol).