1. A method implemented by a network device, the method comprising: providing, by the network device, a ternary content-addressable memory (TCAM); and creating, by the network device, a single virtual database in the TCAM, where the single virtual database includes rules of a plurality of databases and where the rules are interleaved.