4 ms·
Why wouldn't you want to use an SQL database with an index to store this data? Just have a column for the ports and a boolean flag for the status of the port?
by kogepathic 11y ago
Why wouldn't you want to use an SQL database with an index to store this data? Just have a column for the ports and a boolean flag for the status of the port?
Honestly, I'd probably use bash/nmap/ping and psql to insert data. Want to query? psql and grep.
These examples seem like a great way to re-invent the wheel with modern buzzwords.
- Spoom 11y agoI was thinking this as well. This is a problem with a well-defined schema. Why would you use a schemaless NoSQL database? Additionally, many of the bitwise operations used by the old school dev have analogous abstractions in SQL, which are probably easier to understand.
- hackercomplex 11y agoWhy not SQLite ?
- hendler 11y agoor redis
- Sanddancer 11y agoI'd just take that as favorite tool for the job, SQLite's pretty interchangeable. Also, if you've already gotten a database engine running, it's probably best to just keep everything there. Otherwise, you get into the situation I was in at a previous job in which certain page loads from an app written before I started there required a sun jsp app for the main part of the page, which made requests to pull some data from an Oracle database, some data from an apache mod_perl app that queried from a mysql database, some data from an apache mod_jk app that pulled from a c++ app with its own database format, and some data from an apache mod_jk app that stored and retrieved from a postgresql instance. Everything was nice and well-documented, but mein gott was that a lot of moving parts.
- skrause 11y agoIn PostgreSQL you could use a native type to store your IP addresses and subnets (even for IPv6): http://www.postgresql.org/docs/9.5/static/datatype-net-types.html http://www.postgresql.org/docs/9.5/static/datatype-net-types...
- snaky 11y agoIf there's not so many data, awk and sed will do the job. Taking the story to extreme, modern day developer should take a Hadoop (despite the fact it would be 235x time slower than awk - http://aadrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html http://aadrake.com/command-line-tools-can-be-235x-faster-tha...) and old timer should take some APL descendant like Q with kdb+.