开发者

Database: relational/not relational/object oriented... What to choose?

I'm porting a website that I made for app engine to run on a dedicated server. It is coded in java and I'm looking for a database to replace google datastore.

My first thougt was MySql because everybody uses it, but i dont like SQL and I think I would feel more comfortable using OODB or anything else.

With google datastore I could modify my models and don't worry about the database definition at all. I know using MySql that isn't possible. And I don't want to miss that.

And if I use a OODB, which should I use? What about performance compared to MySql?

Well, any idea or tip will really help me since I know nothing about databases.

Edit: about the da开发者_运维问答ta the site handles, it's a microblogging site on a Twitter style but where posts has it's comments. About the amount of data, only future will tell, but I'm building it as if it will become popular, of course.

Edit 2: The application is not using JDO/JPA now, I just made a small layer around the app-engine datastore low-level api.

Edit 3: I wonder if I could use db4o? Is it a right choice for a website to use db4o?


I don't know google datastore features, but I want to give my two eurocents. Without knowing your current and future expected data usage patterns, it's difficult to say. One thing which is clear is knowledge. All the SQL solutions out there (and in particular MySQL and Postgres) are solid and documented for performance, usage, quirks. You know what you are getting into, and any trouble you can have, most likely already happened and was solved. With other solutions, you are more on your own.

Keep this into account. not a full answer, just an opinion.


Well, after some research I found out that db4o is not a good choice for websites because it can't handle high concurrency (I contacted support and that's what they said to me)

The best choice seems to be MongoDB, because it's very similar to google's datastore low level api: It's schema-less, document-oriented, the queries are relatively powerful, it's fast and scales well, full index support.

I analyzed a lot of options and this seems to be the best for this case.


In your app engine version, did you use the JDO or JPA APIs? If so, you can continue to use those with a SQL backend. Datanucleus supports many different backends for their JDO and JPA apis.


According to Google:

Google App Engine includes support for two different API standards for the datastore: Java Data Objects (JDO) and Java Persistence API (JPA). These interfaces are provided by DataNucleus Access Platform, an open source implementation of several Java persistence standards, with an adapter for the App Engine datastore.

http://code.google.com/appengine/docs/java/gettingstarted/usingdatastore.html

Based on this I would suggest looking at JDO and DataNucleus to provide data persistence. Especially since you want essentially the same functionality as that provided by the App Engine.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜