-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Make ZM able to use Postgresql [$250] #355
Comments
Good call On March 24, 2014 5:04:10 PM EDT, Isaac Connor [email protected] wrote:
|
Connortechnology: how about staging your work in a branch, I might be willing to address the "db queries" modifications. Perhaps standardizing the SQL overall, if possible, would be in order? |
@jlpoolen I'm sure he would appreciate your help. |
The mysql2PDO is a start, since PDO will talk to postgres. However, the SQL queries used do need to be standardized. I will be making a branch for it. I think the next step is converting the zm_create.sql into Postgres format, so I can at least easily create all the zm tables in my postgres server. There is a lot of abstraction and cleanup to do all over the code. |
knnniggett: yes, thank you. The title "mysql2PDO" did not clue me into what that project means since I did not know what PDO ( Php Data Objects - http://www.php.net/manual/en/book.pdo.php) was, These are the shortcomings of naming things to familiar acronyms. PDO -- I'm not familiar with PDO, but on looking at the PDO project, seems to make sense, same kind of abstraction as Perl's DBI (Standard "Database Interface" http://dbi.perl.org/) I'm hoping all of the SQL in ZoneMinder is within the context of PHP. |
Sadly, not all SQL is in the php. There is lots in perl (not a probem) and lots in C++ code. I'm not sure which C++ library we should use. I did some research and wasn't terribly excited by what I found. |
So, I'm thinking about this approach and would appreciate any thoughts or critques:
|
I'm looking into this since we're using postgresql at my workplace, few problems i've found:
Since i don't have an active installation to work with, would anyone know where i can find some sample data? just for sanity checks while messing with the schema |
I did the schema work already, see: |
Adding sqlite support as well likely won't be too much more work, and would allow zoneminder to run without an external database server |
libzdb looks suitable. Supports mysql, postgresql, sqlite, oracle, and adds very few dependencies. |
Unfortunately i've had trouble building/running zoneminder, and a number of other projects are in the way. libzdb is suitable and porting is mostly busywork, can afford a small bounty on it if anyones interested. |
just found OpenDBX, looks like a better fit, has better db support and a C++ api |
For convenience, here are links to: |
This could be split into two parallel tasks, one for moving away from mysql client and another for adjusting the schema to be compatible with other db servers. |
Did you consider the SQL I created, I endeavored to make it standard. |
@jlpoolen Yes, there will be a fair amount of work in scripts to upgrade existing installations though. |
@ariscop I'm afraid I'm not understanding the point about "changes in mysql are not transactional." Nevertheless, don't worry about trying to explain it to me, I guess I'm so far away form what I did now I'm out of the loop. I just remember concluding that for purposes of migration, the schema ought to work. Oh well, I hope it's of some help somewhere down the line. |
It also pulls possible enum values from schema, so that would benefit from being replaced with its own table. Would also make plugable sources easier since the database can ensure you don't remove plugins with existing monitors. The other issue is a few places where the next auto_incriment value is pulled from the table, the standard way to do this is sequences, which mysql supports, but does not support using them for an auto_incriment style field (default values can't be a function). This may just need more logic, and i don't think it's used in many places so it should be ok. |
What work is still left on this modification? Also, as far as upgrading the schema: is it a requirement that the scripts do schema upgrades while the system is live, or would it be acceptable for some downtime? Or, could we design the upgrade scripts such that one might do the following:
I think if we could do a step-by-step version upgrade vs. an in-place upgrade, this modification would be easier. |
I'm not sure anyone cares about migration. Not at this point at least. What needs to be done is to change all the code and SQL calls to use some db-agnostic library. |
Revisiting the abstraction layer again. It looks like OpenDBX hasn't been updated for a while. I've used another package called SOCI, which was updated as recently as two months ago. What do you think about this? https://github.com/SOCI/soci |
Yeah SOCI looks to be about the right level for our needs. Is also packaged with ubuntu, so that is nice. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this issue while it isn't solved is wrong. Please reopen. |
Leaving issues open, that no human is interested in touching, is wrong. Thus, until someone steps up and convinces us they will do the work, this issue will remain closed. |
I'm reopening because I am going to get around to it soon. Going to make it a milestone for 1.35 |
Bountysource is going to take the money in this bounty on July 1st unless the funds are redirected. Alternatively I can close this out, collect the bounty and ZoneMinder will hold the funds until it is properly closed. |
Hi all, The changes are based on using the soci library, they contain at the moment:
The steps of the approach are:
Some issues i'm working through:
What is missing yet:
TLDR; |
I am not a coder/developer, but am following this topic with a great deal of interest - am willing and happy to help by adding more to the bounty to help along the work on this. |
Take a look at project moonfire-nvr by Scott Lamb. |
@jlpoolen This is not an acceptable comment. There are lots of other places to discuss ZoneMinder alternatives. Your comments add nothing relevant to the discussion here. @GreasyMonkee I'm sure @parvit would appreciate that. This is a huge effort. |
Some questions.
|
@GreasyMonkee Do you have a specific minimum version of fedora in mind you'd like to see? I could create a yaml specific for that. |
@parvit I would say Fedora 36, as this is where Postgresql14 was released, however now there is Postgresql15 for Fedora Rawhide (becoming Fedora 38) - I personally will run Fedora 37 on the ZM Server |
@GreasyMonkee @connortechnology The tests on freebsd should be fixed by bumping the image version to freebsd 13.1 |
I'm creating this as an issue so that people can post bounties to it.
I've already done the php side by converting zm to PDO. However the C needs to be changed and lots of db queries will need to have their syntax adjusted.
There is a $250 open bounty on this issue. Add to the bounty at Bountysource.
The text was updated successfully, but these errors were encountered: