OneMoreVladimir
OneMoreVladimir

Reputation: 1673

JPA vs JDBC vs NoSQL for MMORPG

We are developing a 2D MMORPG space shooter using Libgdx/Netty and we've faced a question we can not resolve concerning the data.

We are stuck please help us to decide.

Upvotes: 2

Views: 686

Answers (2)

Simon Dorociak
Simon Dorociak

Reputation: 33515

We are stuck please help us to decide.

It for sure depends on requirements. And now what i think. If the main goal is performance i suggest you to implement own ORM, because you will gain total control over queries, mainly you can optimize all your queries for specific requirements.

I don't say that JPA, EclipseLink or another framework is wrong definitely no but the most of ORM frameworks are designated mainly for goal to be independent on database layer so application is independent on datasource type but for sure you can achieve it by implementations of proper datasource design patterns i.e. AbstractDAOFactory, Mappers etc.

I have to mention also that main disadvantage of own ORM is that implementation takes a lot of time but if you want to create good, efficient and working project, it must takes some time.

For this is many views, somebody recommend you to use JPA, Spring or JDBC(where JDBC is for sure faster as JPA) and somebody prefer own ORM. I think an experience gained from more developers should be enough.

And if you want to use technology, use technology you know.

Upvotes: 2

duffymo
duffymo

Reputation: 308998

  1. You realize, of course, that JPA uses JDBC.
  2. Spring can achieve ACID just as easily as JPA can. I don't know what "speed" benefit you're referring to. Development speed? Transaction speed? Why does Spring complicate data management code? This is another incorrect statement.
  3. What speed are you asking about for NoSQL? Development? Runtime? There's no ACID with NoSQL. If that's important to you, why are you even considering it? NoSQL implies "not relational". Is your data relational? If yes, why are you considering NoSQL?

You can't decide performance issues by talking about technologies and guessing. The only way is to benchmark them and get some real data for the transactions that you really care about.

Write interface-based DAOs, implement using each candidate technology, and measure real results. That's how to decide on which persistence technology to use.

Which one do you know well? If no one knows NoSQL, don't use it. If you don't know JPA, don't use it. Spring JDBC template lets you write custom SQL with transactions. If you already know relational databases and Spring well, why wouldn't you just use that?

Upvotes: 2

Related Questions