Derby与mysql的关系_Derby或MySQL还是...?

bd96500e110b49cbb3cd949968f18be7.png

For what type of requirements would you choose Apache Derby (or Java DB) over MySQL (or vice versa)? I looked around and people just compare the two but no one talks about when to consider each one. I am developing a web-based application using Glassfish + Java/Restlet + MySQL.

I expect around 100-200 users for this system with a load of about 30-50 concurrent users at a given time - mostly.

I was told to look at Derby if I wish to make the web-app downloadable/distributable. But is that the only reason why I would use it? Is it suitable for web-apps? Has anyone used it? What has been your experience and when do you choose one over the other? (Most discussions of the comparison predate MySQL v5 when it didn't have support for stored procedures, triggers etc., But that is no longer the case).

I can understand a standalone DB server model with a web-server sending the requests, but how does this model change with an embedded db? Or does one default to using Derby in the network configuration?

解决方案

Why are Derby and MySQL the only RDMBS you consider? If you say Derby, you should check out HSQLDB, H2, SQLite as well. If you say MySQL, you should check out Postgres as well (which has a lot more features).

This is just to name some free RDBMS. Of course, as Charlie already put it, there are lots of others and lots of reasons to go either way. Check out this (IMO excellent) comparison page on Wikipedia, where you will find benefits and limitations of any RDBMS:

As far as your requirement about your webapp being "downloadable" is concerned, of course you can embed an RDBMS (any of Derby, H2, HSQLDB) in your webapp. But you can also just make your MySQL or Postgres or whatever integration configurable and give your downloaders instructions about how to set up your webapp themselves. After all, when you use a container-configured DataSource for your webapp, this configuration can be done easily.

Now, even if you think it might be easier for you to develop your webapp with an embedded database, you should always think one step ahead. Questions like:

Will you be able to connect to that database directly, in order correct data inconsistencies easily? (It will happen to all of us)

Will you be able to alter the schema easily?

Will you be able to backup your data easily?

etc etc... there are more maintenance questions, too

Since your comments suggest that your data is increasing over time, and it should persist, I wouldn't choose an embedded version, but keep the data separate from the application. Note that this doesn't exclude Derby from your application design. It just means you'd have to run Derby as a standalone server.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值