0

在设计一个新的基于 J2EE 的企业框架时,我是否必须为单独的业务模块必须使用不同的数据库并且必须在不同的应用服务器实例上运行的情况做好准备?

从另一个角度来看:有没有人经历过每个模块对不同数据库和服务器的实际需求?如果是,那家企业的规模是多少?

因为(据我所知)这使事情变得更加复杂,并且使用该框架的先前版本(以及在较小的银行中),上述情况从未发生过。

感谢您的回复!

4

1 回答 1

0

I'm not sure I've understood this phrasing correctly

where separate business modules have to use different databases

All the time.

Perhaps we're talking about different things here. I've never met any organisation without at least two databases. That includes me and my CD catalogue and guitar tunes databases on my laptop.

Do you mean different database vendors? Database versions, like Oracle vX and Oracle vY? Even under that definition I can think of no customers I've encountered who have universally stanadardised one one vendor or version.

So, would I expect a non-trivial system to have some modules looking at one database and some looking at another. Yes abolsutely.

Would I expect some modules to look at two databases, yes. Reference data in one live in another. History in yet another.

Different modules on different servers - yes. For reasons of isolation and scalability. That's one thing App Servers do quite well.

Overall, why do you see this as a problem? Your modules look up their JDBC connections in JNDI, they don't need to know that they are using different databases. It's an admin problem to wire up the modules correctly.

One major issue could be the use of XA transactions, but it's often possible to avoid updating both databases in the same module, or if from the same module in the same transaction.

于 2009-09-14T14:43:18.470 回答