Ryusenshi wrote: ↑Wed May 27, 2020 1:12 amI did look into SQL databases for another project, but got kinda lost between all possible versions (SQLite? MySQL? PostgreSQL? MariaDB? LibreOffice Base?). Especially the part when you have to set up a server and a client, even if you're only running on a single computer.
I hate how people tend to write over-complicated tutorials, presumably assuming that people want to learn to use complex tools in professional ways from day 1. I assume that's why you seem confused anyway.
There is a subset of basic SQL that is the same (or at least accepted) by all those engines. Then the engines also have extra capabilities, sometimes
many.
This does mean that if you change your database engine, you may have to rewrite all your statements ("queries") again. This is why some swear by limiting themselves (and, more importantly, their co-workers) with libraries like PDO for PHP, which force people to use a subset of capabilities that work across databases and also leave the query details to the library maintainers. This is also why some put all custom queries in their own separate DAO (data access object), so that changing the database engine means changing the code of the DAO without changing the rest.
The words "server" and "client" can simply refer to a program offering a service to another program, like here. If everything is inside one computer, then the engine (MariaDB, PostgreSQL...) is the "server" and your program (in C, Python, PHP... or LibreOffice Base, the GUI program you wrote in Python...) is the "client".
Regarding engines:
- SQLite is the lovable stupid simple engine where the data is stored in a single file that you can just copy-paste elsewhere or share around.
- PostgreSQL and MySQL are much more powerful engines that are more complex to understand but generally function a lot faster and more efficiently when large amounts of data are involved (and appropriately structured, like having a consistent length even if it means adding null space).
- MariaDB is a very popular fork of MySQL made after Oracle (may God judge them harshly) bought the legal rights to MySQL, and MariaDB remains (almost) 100% compatible with it to encourage people to abandon it. However, the compatibility also means that people keep referring to MariaDB as "MySQL".
- Microsoft SQL Server is that company's proprietary professional engine, usable by Microsoft Access besides C# and many other languages through libraries.
- Microsoft Access uses its own little internal engine making .accdb files that can be shared around like SQLite files can. In the old days it used a different one that created .mdb files.
- Since 2019 LibreOffice Base is a client that uses the Firebird engine by default inside its files, which can then be easily copied and shared around. Before it used HSQL. That program can also connect to many other engines, including PostgreSQL and MariaDB.
chris_notts wrote: ↑Wed May 27, 2020 2:20 ambut the result will be much better for random access from other code.
What do you mean by this?