AHKCon 7: Data Storage (ini,text,JSON,XML,SQL, etc.)
Channel: AUTOHOTKEY Gurus
Date: 07/08/2022

In hour 7 of AHKCon we discussed the pros & cons of using various storage types.  Deciding on the "best" way to save user input is more complicated than you might think.  Here we review many approaches and why you'd select one over the other.

Want to learn more about AHKCon go here:  https://the-Automator.com/AHKCon

TLDR: When dealing with data, consider the type and usage to decide which storage method to use, and focus on learning the methodology and way of thinking to build your skill set.

1. 00:00 🤔 Watching experts use their text editors is fun, and JSON strings are a popular choice for storing data due to their small size.
 1.1 Watching people who have mastered their text editor is fun and surprising, and XML was not included in the poll.
 1.2 XML is fast and powerful for small data sets, but performance decreases significantly when data size increases.
 1.3 People mostly use text files, CSV files, JSON files, and SQL databases to store data, but the Windows Registry is also an option for secure storage.
 1.4 Using tab-delimited files instead of comma-delimited files is recommended, and any files are a quick way to save information if there are only key-value pairs, but they become a nightmare to work with if there are hierarchies of settings.
 1.5 JSON strings require less data than XML strings, making them a popular choice for storing data.
 1.6 I like Deskalotta's poop-delimited list.

2. 08:51 🤔 When deciding between plain text files and compiled databases, consider the trade-offs between flexibility and speed.
 2.1 JSON is more popular due to better support in JavaScript, but XML is still widely used and supported by many tools.
 2.2 JSON strings are quick and easy to use, but when dealing with large amounts of data, databases like SQL are more efficient.
 2.3 Compiled databases are the go-to for speed and multiple user/program access, while unstructured data like JSON, XML, etc. is also available.
 2.4 MongoDB has flexibility and ease of modification due to its transpiled strings, unlike a normal SQL database.
 2.5 When deciding between plain text files and compiled databases, one must consider the trade-offs between flexibility and speed.
 2.6 Nosql implementations are well-suited for unstructured and large data sets, while SQL is better for structured data.

3. 20:31 🧹 Clean data before storing it to ensure accuracy and avoid special characters.
 3.1 Clean data before storing it in any structure to ensure accuracy.
 3.2 Storing values in ini files should not contain equal signs as they have a special meaning and can cause issues when reading the file.
 3.3 Always clean data before saving it into a database to avoid special characters.
 3.4 Data normalization is not always about cleaning data, but rather applying a consistent format.
 3.5 Chad reviews the difference between cleansing and sanitizing, which is removing unwanted items and making it safe for storage, respectively.
 3.6 He's demonstrating something and trying to explain what he's working on.

4. 27:59 🤔 When dealing with data, consider the type and usage to decide which storage method to use.
 4.1 It is possible to flatten a parent-child relationship into a one-liner, but it is less elegant.
 4.2 XML is human-readable and can be used to build transformative interfaces with XSLT, which can be rendered as clean HTML.
 4.3 YAML can be flattened using a delimiter such as a dot to conserve a tree view in a file.
 4.4 Abstraction means wrapping low-level functions to avoid having to sanitize data every time it is written to a file.
 4.5 It depends on what you're trying to do, but for saving settings, any file type is usually sufficient, but for larger files, a database may be necessary for speed and flexibility.
 4.6 When dealing with data, the type of data and how it will be used should be taken into account when deciding which storage method to use.

5. 35:46 🔒 Put enough security measures in place to make it difficult to hack your system, and embrace open standards and cloud-hosted databases to make it less hackable.
 5.1 Storing license keys in a cloud-hosted database and having programs be licensed using the license keys is a better solution than storing them in the user's computer, but there are ways around it.

6. 46:43 💡 Focus on learning the methodology and way of thinking to build your skill set, and use simple solutions first.
 6.1 Start with what feels good and build your skillset, don't worry about what's better.
 6.2 Find the simplest solution first, and switch to a more complex one if it doesn't work.
7. 51:25 🤔 Learning to code can be a journey of discovery, so don't be afraid to ask questions and use resources to help you along the way.
 7.1 Watching someone else code can help you learn more than just staring at it.
8. 58:34 💡 I can show you how to organize projects without hotkeys.