How to find a chemical by its formula?
This answer is meant to address your second question about computerized representations of molecule structure since comments have already addressed your first question.

To truly represent the structure, mol and sdf formats are common: https://en.wikipedia.org/wiki/Chemical_table_file

Common string representations include SMILES and InChI. An issue with smiles is that there are multiple valid ways to represent a given molecule, which means a simple string match is not a good test for sameness. Canonical SMILES and InChI attempt to address this issue via additional rules. InChI additionally provides a standard way to convert the sometimes very long InChI strings into 27 character hashed version called InChIKey, which are better for searching.

Example Acetoin
SMILES string: CC(C(=O)C)O
InChI string: InChI=1S/C4H8O2/c1-3(5)4(2)6/h3,5H,1-2H3
InChIKey string: ROWKJAVDOGWPAT-UHFFFAOYSA-N