3 ms·
A company I work for runs MySQL on an IoT base station product (Beaglebone-like hardware). Tables seems to corrupt every so often, which typically are repairab
by agildehaus 4y ago
A company I work for runs MySQL on an IoT base station product (Beaglebone-like hardware). Tables seems to corrupt every so often, which typically are repairable with a "mysqlcheck --auto-repair" which they have as part of the boot sequence, but not always. These corruptions seem to be due to bad batteries or the field team holding down the power button too long.
Would sqlite be less prone to table corruption?
- bob1029 4y agoI think yes - If you configured something like: PRAGMA journal_mode=WAL; PRAGMA synchronous=NORMAL; This should be very safe & still reasonably fast. See: https://www.sqlite.org/pragma.html#pragma_synchronous https://www.sqlite.org/pragma.html#pragma_synchronous and https://www.sqlite.org/wal.html https://www.sqlite.org/wal.html
- RedShift1 4y agoI run about 100 computers that regularly receive power cuts and have not have databases go corrupt. However we also write to the database every minute or so, all data is packed into compressed chunks that contain a minute of data.
- eli 4y agoYou should take a look at your mysql settings e.g. `innodb_flush_log_at_trx_commit` but yeah mysql isn't really built for frequent sudden shutdowns.
- slt2021 4y agoproblem is in application layer and mysql settings. you can try to switch from myisam engine to innodb engine, tune innodb settings, write inserts in batches, rather than continuously, and wrap insert into transaction