开发者

web application in DB4O

开发者 https://www.devze.com 2023-02-22 22:10 出处:网络
If I\'m going to develop a web 开发者_JS百科application in ASP.NET using db4o what kind of database would it be: local or remote type, and why?I think you mean \"embedded\" vs \"client server\" (those

If I'm going to develop a web 开发者_JS百科application in ASP.NET using db4o what kind of database would it be: local or remote type, and why?


I think you mean "embedded" vs "client server" (those are the two basic modes that db4o can operate in.

You will most likely want "client server" so that you can spin up multiple client sessions (perhaps one per request?).

The decision as to where to put the database depends on your scenario. Ideally, you would architect your solution so that you could do it either way via configuration. The way you can service up db40 in process in the case of a single server deployment.

However, if you need more horsepower, you could serve the db40 off of another machine to distribute the work. Note that in this case you will have more network overhead / latency.


The C/S mode of db4o implies network communications and is slower. If you need multiple client sessions you don't necessarily need to go with C/S because there's an embedded server mode that allows to have multiple transactions in parallel without the overhead of networks communication:

http://developer.db4o.com/documentation/reference/db4o-8.0/java/reference/Content/client-server/embedded.htm

So if your use case allows it you could open an embedded server on the web server side and allow your server side asp.net app to talk to db4o using multiple transactions (eg one per web session) to persist objects. Note that under this scenario you can't persist objects from the client side (the web client talks to the server side of your app which takes care of persistence).

Important: in web scenarios is not uncommon that you close the db4o object container when a session is over. If you do this the object is no longer tracked by db4o and it will be treated as a new one on the next session. You'll have to find a way to reattach objects to its db4o identity on the server side for a different session (you can do that by querying for the object again on the server side).

Best!

German

0

精彩评论

暂无评论...
验证码 换一张
取 消