3 ms·
Well depends on the case, I needed a fast ip to country resolving, really fast one. I did my database in C for it and it was 120 times (yes!) faster than fully
by _o_ 8y ago
Well depends on the case, I needed a fast ip to country resolving, really fast one. I did my database in C for it and it was 120 times (yes!) faster than fully optimized postgres table, not to mention memory, disk and cpu footprint.
Custom made database for just a specific problem can be a lot faster than generic one. But depends on your knowlidge.
- jacquesm 8y agoThat's just a lookup table, not a database.
- smittywerben 8y agoAt least to be fair he is comparing with Postgres. I'm still unsure whether a database would benefit me, or if keeping everything flat is easier for ~50GB on a single machine. I'm leaning towards yes, as does the article, but my log files do not need much maintenance so I do not make persistent transformations.
- _o_ 8y ago"A database is an organized collection of data." By definition. First sentence in wiki. I don't know what are your definitions.
- smittywerben 8y agoI could be misinterpreting but I believe a lookup table is more of a suggestion than anything. It would be easier than for instance a hash table, or rather in networking, a deterministic solution is more common. I'm obviously not a systems programmer though so I can't provide much else.
- jacquesm 8y agoIf you want to call a lookup table a database I'm ok with that.
- hinkley 8y agoBut that means I'm writing my own databases at least a couple times a year. I'm not sure I'm okay with that.
- autokad 8y agoyeah, just a hash table would suffice
- _o_ 8y agoIt was actually simpler, I have packed from and to range into uint64, added data offset, ordered at generation of db file and searched using bisection. Used the fact that ip is just a uint32 and range can fit into one register on 64 bit machine. Fixed size range (+data) enabled me to calculate position in file so bisection was simple.