FAQ  •  Register  •  Login

Choose database engine ?

<<

sbocquet

User avatar

Streaming enthusiast

Posts: 22

Joined: Thu Aug 04, 2011 12:37 pm

Location: Lyon, France

Post Thu Aug 04, 2011 2:33 pm

Choose database engine ?

Hi,

First of all, I must say that Serviio works great, and that it's really a nice piece of software.
Sorry if I have already posted those thoughs in another thread, but I think it was misplaced.

As I experiment some performance problem with my numerous files on my server, I was asking myself if it can be a benefit to put it on another database engine as Serviio is acceding to the database every X min to check if metadata already exists. It can be very long with numerous files.

I think that one piece of the problem is the java browsing. There's a hope with Java 7 in this direction which is "event oriented", and so Serviio don't have to always browse all files in all directories... but simply ask for a change in it.

The other piece is perhaps the embeded java database engine. I know that embeded database can be very fast as they are load in memory, but there's one moment where the database cannot fit into memory ;) Plus, a native system database is surelly a little more optimized than a Java one.
Don't know really if Derby is faster than MySQL or other db engine, but is it possible to have the connection URL in a propertie file, in order to choose the db.

Also, I already have a MySQL engine running on my linux DLNA server, and it would be nice to put Serviio db in it (only one db engine on the server, less memory usage). I imagine that using Derby is probably a "deployment choice", as it more easier as the database engine is embeded with the server... and I can understand and agreed, but with putting the database URL in a properties file, some of us can easily choose to change the db engine.

As a Java developper, I know that there's a little code change in the Connection Pool class, but the choice is yours of course ;)

Hope I can by heard ;)

Have a nice day.
Sony KDL-40X3500 | Marantz SR7005 | Marantz UD5007 | Sony PS3 | Windows 7 | Windows Server 2012 Essentials
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Aug 04, 2011 2:49 pm

Re: Choose database engine ?

I am starting to develop databases commercially, and derby actually looks like a good embedded / server database.

Here is a site that has a Comparison of OpenJPA with MySQL server vs Hibernate with Derby server

http://www.jpab.org/OpenJPA/MySQL/server/Hibernate/Derby/server.html

here is another.

http://www.encorewiki.org/display/encore/Open+Source+Databases+Comparison
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

sbocquet

User avatar

Streaming enthusiast

Posts: 22

Joined: Thu Aug 04, 2011 12:37 pm

Location: Lyon, France

Post Thu Aug 04, 2011 3:18 pm

Re: Choose database engine ?

Thanks for the links...

For the first link, I can see that it's very close between the two, but MySQL seems to have average better performance.
For the second, it's the contrary ! lol...
And here, Derby is the slowest ! (http://www.h2database.com/html/performance.html)

I think that it's probably just a personnal choice in fact... so putting the db connection URL in a propertie file can be interesting ;) lol
Last edited by sbocquet on Thu Aug 04, 2011 3:19 pm, edited 1 time in total.
Sony KDL-40X3500 | Marantz SR7005 | Marantz UD5007 | Sony PS3 | Windows 7 | Windows Server 2012 Essentials
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Aug 04, 2011 3:19 pm

Re: Choose database engine ?

Also you have to look at the licenses. If you use Mysql you have to share your source code. unless you buy the licenses. Derby you do not.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

sbocquet

User avatar

Streaming enthusiast

Posts: 22

Joined: Thu Aug 04, 2011 12:37 pm

Location: Lyon, France

Post Thu Aug 04, 2011 3:24 pm

Re: Choose database engine ?

You're right ! I probably have to have multiple database engine on my server so ;)

Zip, any chance to put the connection URL in serviio properties file ? ;)

Thanks a lot
Sony KDL-40X3500 | Marantz SR7005 | Marantz UD5007 | Sony PS3 | Windows 7 | Windows Server 2012 Essentials
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Aug 04, 2011 3:29 pm

Re: Choose database engine ?

Also in the new 0.6 beta Zip has been optimizing the database to improve speed.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Aug 04, 2011 5:32 pm

Re: Choose database engine ?

DB URL is in properties file inside serviio.jar. Obviously I'm not sure if it'll work as Derby might use some non-standard SQL syntax, but feel free to give it a go.
<<

sbocquet

User avatar

Streaming enthusiast

Posts: 22

Joined: Thu Aug 04, 2011 12:37 pm

Location: Lyon, France

Post Thu Aug 04, 2011 9:05 pm

Re: Choose database engine ?

Hi !

I've done a some "research" in servioo.jar... and found db_schema_url. That's a nice maven project (pom.xml ;)
I've read that the source code isn't downloadable.
But do you authorize to reverse the java build classes in order to modify the DB connection classes and try to rebuild the project with a connection to a MySQL db for example ?
That would be some works without the source code and the project structure but I'm really interested in comparing the results between Derby and MySQL. Plus, I can build some web apps based on Serviio's library metadatas. I've read that some are interested in seeing their library infos...
Sony KDL-40X3500 | Marantz SR7005 | Marantz UD5007 | Sony PS3 | Windows 7 | Windows Server 2012 Essentials
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Aug 05, 2011 6:29 am

Re: Choose database engine ?

yes, you can reverse engineer it, for your own use
<<

sbocquet

User avatar

Streaming enthusiast

Posts: 22

Joined: Thu Aug 04, 2011 12:37 pm

Location: Lyon, France

Post Fri Aug 05, 2011 7:07 am

Re: Choose database engine ?

I guest there's no way to have the maven project structure to help me, even for my own use? :roll:
Sony KDL-40X3500 | Marantz SR7005 | Marantz UD5007 | Sony PS3 | Windows 7 | Windows Server 2012 Essentials
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Aug 05, 2011 7:12 am

Re: Choose database engine ?

I think kairoh managed to run serviio on H2 database just by changing the URL and driver, so first give that a try before changing the code itself.
<<

sbocquet

User avatar

Streaming enthusiast

Posts: 22

Joined: Thu Aug 04, 2011 12:37 pm

Location: Lyon, France

Post Fri Aug 05, 2011 9:37 am

Re: Choose database engine ?

Ok, I will try as soon as I have created the database structure...
Derby SQL syntax isn't very "SQL normalized", and I have to modify your SQL scripts ;)


Ok, done...
But I have to modify the DbConnectionPool class to register mysql driver.
I'm trying to recreate the maven project in order to compile the classes but I miss the serviio-parent project...
Sony KDL-40X3500 | Marantz SR7005 | Marantz UD5007 | Sony PS3 | Windows 7 | Windows Server 2012 Essentials
<<

sbocquet

User avatar

Streaming enthusiast

Posts: 22

Joined: Thu Aug 04, 2011 12:37 pm

Location: Lyon, France

Post Fri Aug 05, 2011 1:26 pm

Re: Choose database engine ?

Hi Zip,

For future release and improved file performance, perhaps you could have a look at this (file notification). I just tried it and it works like a charm... The fact is that you need to go to Java 7...

http://download.oracle.com/javase/tutor ... ation.html

Cheers,
Sony KDL-40X3500 | Marantz SR7005 | Marantz UD5007 | Sony PS3 | Windows 7 | Windows Server 2012 Essentials
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Aug 06, 2011 5:17 pm

Re: Choose database engine ?

it's something I'm looking at... but will wait for java 7 to be more spread across different platforms
<<

kairoh

DLNA master

Posts: 180

Joined: Sun Aug 08, 2010 10:41 am

Location: France

Post Wed Aug 24, 2011 8:42 am

Re: Choose database engine ?

zip wrote:I think kairoh managed to run serviio on H2 database just by changing the URL and driver, so first give that a try before changing the code itself.

Serviio works easily on H2 (don't even need Derby compatibility mode).
You just have to change the url and remove serviio's db shutdown hook (cause h2 provides one).
Here is the bitbucket issue.
H2 is faster than Derby, so is the scanning process. I uses fewer files than Derby and its memory footprint is better.

The drawback is the database should be recreate from scratch.

I've already tried with Hsqldb but there where issues with current sql code.
I think many other db (Mysql, PostgreSQL Oracle, ...) will present this kind of issue too.
Serviio WebUI console developer : New Homepage | Support | Project | Issues

Samsung UA32C6600 | WinXP / Ubuntu 11.10 | Samsung Galaxy S | Freebox v6
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Thu Aug 25, 2011 11:20 pm

Re: Choose database engine ?

Those comparison stats you posted about H2 look impressive, especially for the low power embedded systems running Serviio like NAS units.
Is it really such a big deal to have to rebuild the DB going to a new major version release? Personally I wouldn't let that reason hold back such a clear performance bump, doubly so considering how many forum posts there are bemoaning high CPU use.
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!
<<

Cerberus

User avatar

DLNA master

Posts: 4114

Joined: Sun Jan 02, 2011 5:20 pm

Location: Reading, UK

Post Fri Aug 26, 2011 12:21 am

Re: Choose database engine ?

sbocquet wrote:For future release and improved file performance, perhaps you could have a look at this (file notification). I just tried it and it works like a charm... The fact is that you need to go to Java 7...


i stand with ZIP on this point yes brilliant faster performance but if it wont work with all platform then its useless..

patters wrote:Those comparison stats you posted about H2 look impressive, especially for the low power embedded systems running Serviio like NAS units.
Is it really such a big deal to have to rebuild the DB going to a new major version release? Personally I wouldn't let that reason hold back such a clear performance bump, doubly so considering how many forum posts there are bemoaning high CPU use.


i second that if it really is significantly faster then a switch maybe a good idea going into 0.6 BUT as for the people complaining of the high cpu usage they need to understand that even with a different db engine the Transcoding process will still use alot of cpu as well so gain wont be as most will be expecting, i would expect only to see about 10% max decrease in cpu usage overall.

my only question is will it work for ALL platforms currently supported by serviio? Windows xp/vista/7, Mac OSx, Linux, BSD.
Phil Bennett
Beta Tester Group
Wiki | FAQ

Samsung LE40C750 LCD | Samsung BD-C5900 | Sony PS3 | Windows 7 |
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

kairoh

DLNA master

Posts: 180

Joined: Sun Aug 08, 2010 10:41 am

Location: France

Post Fri Aug 26, 2011 8:12 am

Re: Choose database engine ?

Cerberus wrote:i second that if it really is significantly faster then a switch maybe a good idea going into 0.6 BUT as for the people complaining of the high cpu usage they need to understand that even with a different db engine the Transcoding process will still use alot of cpu as well so gain wont be as most will be expecting, i would expect only to see about 10% max decrease in cpu usage overall.

The total scanning process is faster (cause SQL instructions are faster), and memory and disk usage should be smaller too.
I don't think CPU usage will be significantly reduced.
In fact, H2 is more multi-threaded.
Transcoding should not be affected by the database.
Cerberus wrote:my only question is will it work for ALL platforms currently supported by serviio? Windows xp/vista/7, Mac OSx, Linux, BSD.

Yes it will : H2 is pure java database just like Derby.
Serviio WebUI console developer : New Homepage | Support | Project | Issues

Samsung UA32C6600 | WinXP / Ubuntu 11.10 | Samsung Galaxy S | Freebox v6
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Aug 26, 2011 8:47 am

Re: Choose database engine ?

kairoh, would it be possible to run a test with both DB's and measure:
1) the time it takes to add a set of files
2) the time it takes to check if there are any new files (ie second run of the loop) and if you can see any high CPU usage in this step (FFmpeg not running)
3) the time it takes to check if there are any updates to the currently shared files (make sure the checkbox is selected in the console)

Obviously this would have to be run on a relatively big file set (e.g. 100). Also run it in a clean installation of the latest beta (includes some added indexes).

If it's too much bother, don't worry.
<<

sbocquet

User avatar

Streaming enthusiast

Posts: 22

Joined: Thu Aug 04, 2011 12:37 pm

Location: Lyon, France

Post Fri Aug 26, 2011 4:31 pm

Re: Choose database engine ?

Hi all !

I was on holidays these last weeks, so I haven't been working on the MySQL tests.

I have transalate the serviio db schema in a MySQL one, but can start the server at the moment has I have some problem with the connection classe, as I have to register the MySQL java driver.

Can the 0.6 release of serviio add a more configurable connection classes, based on properties file in order to let people "choose" their db engine ? I can help in that as I'm very interested with that.

Cheers...
Sony KDL-40X3500 | Marantz SR7005 | Marantz UD5007 | Sony PS3 | Windows 7 | Windows Server 2012 Essentials
Next

Return to Feature requests

Who is online

Users browsing this forum: No registered users and 59 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.