Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customising the database engine in installation #8170

Closed
quba opened this issue Jun 22, 2015 · 10 comments
Closed

customising the database engine in installation #8170

quba opened this issue Jun 22, 2015 · 10 comments
Assignees
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone

Comments

@quba
Copy link
Contributor

quba commented Jun 22, 2015

Please see this line:
https://github.com/piwik/piwik/blob/master/config/global.ini.php#L22

  • it's OK to set this value by default to InnoDB during the installation process (so type in config.php.ini will be set to InnoDB) - it's always better than using MyISAM for most of the users,
  • maybe during installation process it should be possible to choose DB engine, e.g. when there's a combination like MariaDB + TokuDB? But I guess it won't be possible to get the list without connecting to the DB. In addition installation process should be easy and fast.
  • if DB engine is not set in config.ini.php, Piwik should fallback to default DB engine - default-storage-engine setting in DB configuration file (my.cnf) - this means no ENGINE = XXXXX in CREATE TABLE queries. Currently it falls back to type=InnoDB which is set in global.php.ini
@tsteur
Copy link
Member

tsteur commented Jun 24, 2015

I made some changes but I'm not sure if I understand this issue

@quba
Copy link
Contributor Author

quba commented Jun 24, 2015

Thanks @tsteur !
Can we somehow check if TokuDB is available? What if only MyISAM is available (I don't know if such case is possible)?

https://github.com/piwik/piwik/blob/master/config/global.ini.php#L22
This one shouldn't be hardcoded to InnoDB in my opinion. Better way would be to fallback to default-storage-engine. @mattab do you have any comments here?

@tsteur
Copy link
Member

tsteur commented Jun 24, 2015

This one shouldn't be hardcoded to InnoDB in my opinion. Better way would be to fallback to default-storage-engine

I don't understand the problem. It's basically the same with a different name or not?

Can we somehow check if TokuDB is available? What if only MyISAM is available (I don't know if such case is possible)?

I don't know how to do this without introducing a new step but then the tables are already created (and we have to run alter table engine=...). We need a database connection to get the available engines. I will delete my commit again as this seems like quite a bit of work.

Would it be maybe better to have a command to change the engine of all tables? Such a command should run very quickly after a fresh installation of Piwik

@quba
Copy link
Contributor Author

quba commented Jun 24, 2015

I've just updated ticket description. Maybe it's more clear now.

@mattab
Copy link
Member

mattab commented Jun 24, 2015

I don't think it's safe to use the default mysql engine. For example what if the default engine is set to an engine that does not support features we need? it is Piwik job to force users to use only engines that will work fine (Innodb or TokuDB).

If our goal is to let users install on TokuDB the current solution with new select field, should do the trick?

@quba
Copy link
Contributor Author

quba commented Jun 24, 2015

That's good point. There are also other compatible engines like XtraDB. Not sure how to proceed.

@mattab
Copy link
Member

mattab commented Jun 24, 2015

Our goal is to let users install Piwik on TokuDB. I would change this issue description to "Let users install Piwik on TokuDB database" and then close it as done?

@mattab
Copy link
Member

mattab commented Jun 24, 2015

Note to self: test what happens when installing selecting TokuDB and TokuDB is actually not available. Does it fail gracefully, show the form, and then let me select Innodb?

@mattab mattab self-assigned this Jun 25, 2015
@mattab mattab added this to the 2.14.0 milestone Jun 25, 2015
@mattab mattab changed the title Use default DB engine if database type is not set customising the database engine in installation Jun 25, 2015
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Jun 25, 2015
@mattab mattab closed this as completed in 6bf50fa Jun 25, 2015
@mattab
Copy link
Member

mattab commented Jun 25, 2015

Final decision:

  • we don't show the field during the installer to keep installer as clean as possible
  • it will be possible to set the database engine in Piwik Enterprise with this change (from 2.14.0)

@mattab
Copy link
Member

mattab commented Jun 25, 2015

New FAQ published: How do I install Piwik using TokuDB table engine in a Mysql or MariaDB database?

Updated FAQ: How do I use another database like Postgresql, SQLite, Oracle? Will you support Nosql databases like Hadoop, Mongodb? to link to it

(Note: I didn't actually test it, but I tested with Myisam/Innodb which worked so I assume tokuDB will work too. if not, we will fix it next release after feedback from Piwik Enterprise team)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

3 participants