Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Create the db tables with InnoDB storage engine #169

Closed
wants to merge 1 commit into from

Conversation

miklos-szel
Copy link

@miklos-szel miklos-szel commented Jan 10, 2019

Since the integrity of the photos_table and the rest of the tables is vital for running Lychee I suggest moving to the InnoDB storage engine.

Using MyISAM is contraindicated as it's not crash safe(one can lose data when the under
lying database crashes) and it only supports table level locking(backup will cause longer lock).
The InnoDB is a modern storage engine that uses doublewrite buffer and redo log to achieve durability and crash safety.

Changing the storage engine doesn't need any application code changes.

The existing tables can be converted with
ALTER TABLE x engine=InnoDB;

This is a locking operation, but it won't take longer than a couple of seconds for a table with 10.000 rows, somebody with a really large (1 million photos) deployment might want to use pt-osc if having a downtime is not possible.

@ildyria
Copy link
Member

ildyria commented Jan 10, 2019

Actually this is already solved in the V4.

tables

@ildyria
Copy link
Member

ildyria commented Jan 10, 2019

Rather than modifying the table at creation, can you make an "update patch" ?
eg. https://github.com/LycheeOrg/Lychee/blob/master/php/database/update_030209.php

@miklos-szel
Copy link
Author

@ildyria awesome!

I can make an 'update patch' for sure! Should I patch the file you linked or create a new one for a future version ( like: update_030210.php for 3.2.10?)

@ildyria
Copy link
Member

ildyria commented Jan 10, 2019

I can make an 'update patch' for sure! Should I patch the file you linked or create a new one for a future version ( like: update_030210.php for 3.2.10?)

With the current upgrade process of Lychee, if you change update_030209.php then it will never be executed to current users doing a git pull. So update_030210.php is needed yes. 👍

d7415 added a commit to d7415/Lychee that referenced this pull request Jan 19, 2019
@d7415 d7415 closed this in 97e984c Jan 19, 2019
@ildyria ildyria added this to the v3.2.10 milestone Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants