[retronet] Random thoughts about databases and config management.
Michael Kjörling
michael at kjorling.se
Wed Sep 12 03:59:06 MDT 2018
On 12 Sep 2018 07:36 +0300, from retronet at mailman.chivanet.org (Mantas Mikulėnas via retronet):
>> I think we need to name interfaces using the
>> “${RNmemberName}-${memberNodeName}” format.
>
> Beware of 16-byte length limit on the interface names in a popular
> operating system.
Make RNmemberName be the four-hex-digit member number, and dispense
with the hyphen. Leaves 12 ASCII characters for the node name. That
should be plenty, and will also guarantee uniqueness as long as each
member chooses unique-to-themselves node names.
>> So, I think we need a DB (or comparable) / table that will enforce unique
>> member names as well as one that enforces unique node names for the member.
>> I don’t know how to do the second enforcement.
>
> As far as I know in at least MySQL tables you can make an index covering
> multiple columns. In the `nodes` table, creating a 'unique' index over
> (memberName, nodeName) would ensure that the combinations are unique, even
> if nodeName itself is not.
Yes; multi-column indexes, including unique indexes, is a standard
feature in any halfway competent database.
> (Though my first attempt at a "DB" would have been a bunch of textfiles in
> Git repository, letting the filesystem itself sort out uniqueness.)
I agree, let's not overengineer. Remember good ol' hosts.txt.
--
Michael Kjörling • https://michael.kjorling.se • michael at kjorling.se
“The most dangerous thought that you can have as a creative person
is to think you know what you’re doing.” (Bret Victor)
More information about the retronet
mailing list