Recent

Author Topic: Suggest on choosing a DB engine  (Read 2776 times)

Edson

  • Hero Member
  • *****
  • Posts: 1328
Suggest on choosing a DB engine
« on: March 12, 2017, 11:04:11 pm »
I'm looking for some suggestions. I hope I can explain this correctly. I have an App running on Windows PC. It has some few tables (configurations and historical) in some kind of CSV files, controlled for some code that can hardly be called Database Manager.
I was thinking on migrate this, to a "real" Database library. But it's some difficult for me to find the appropriate. The main requirements are:
- The tables must be stored in single files (like DBF or CSV), and in a compact format.
- The historical tables must be partitioned monthly.
- The database manager must be integrated in the Program. No need for DLL or external libraries or servers.
- Only one connection is needed, the one from the server.
- The database manager must be efficient on CPU, and memory.
And the critical, requirement:
- The information stored must be secure in the case of the PC are suddenly powered off.  :-[

I was thinking on using ZMSQL or TDBF, but I'm not sure how secure are they. Or maybe I must keep on my old code, and no migrate.  :o
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

ertank

  • Sr. Member
  • ****
  • Posts: 276
Re: Suggest on choosing a DB engine
« Reply #1 on: March 12, 2017, 11:37:16 pm »
Hi,

As far as I understood your requirements right. I would suggest you SQLite3.

One thing I am not sure about your need: "historical tables must be partitioned monthly".
Do you mean removing old tables from database? Or changing table names in the database? Or, completely different thing?

Please note that no database engine is able to prevent data loss in case of a power failure.

Edson

  • Hero Member
  • *****
  • Posts: 1328
Re: Suggest on choosing a DB engine
« Reply #2 on: March 13, 2017, 12:50:04 am »
As far as I understood your requirements right. I would suggest you SQLite3.

Well, I have been very tempted to use SQLite, but FAIK it doesn't store each table in one file. Maybe I can use it, only in the Configuration tables. Althought, thinking :-\ .. . configuration tables, could be also historical tables.

Do you mean removing old tables from database? Or changing table names in the database? Or, completely different thing?
The idea is not to have a big historical table, so I prefer to have one table (or more) every month. So the transactions of the current table, would be fast.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
Re: Suggest on choosing a DB engine
« Reply #3 on: March 13, 2017, 08:49:28 am »
MySQL /mariaDB is using a file for each table. But it's not exportable without using export.
Quote
The idea is not to have a big historical table, so I prefer to have one table (or more) every month. So the transactions of the current table, would be fast.
A very large table is even fast as a small table if the indexes are build correctly.
Quote
Only one connection is needed, the one from the server.[/quoted]
That's not possible. Each client has his own connection. Only embedded databases has only one connection.
Quote
The database manager must be integrated in the Program. No need for DLL or external libraries or servers.
If your using opensource DBFramework it's not possible. In Delphi I use MyDAC from devart. This framework has his own build connection to the database (AFAIK from MySQL). In lazarus it can work too, but you have to pay it full (framework + source) to build it in Lazarus.
Quote
The database manager must be integrated in the Program. No need for DLL or external libraries or servers.
.
mORMot has an built in driver for SQLLite, but it's a single file.
 
 
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

 

TinyPortal © 2005-2018