Today I reviewed postgreSQL wiki and I found it is a ORDBMS (object-relational database management system), so I want to know is there any benefits for using postgreSql (RDBMS) behind the JPA (hibernate, eclipselink, ....) instead of a RDBMS (Mysql, ...) for performance issues or not?
As you know JPA use ORM and use JQL (java query language)
Regards
Object-Relational data is defined as structured data, which is user defined types in the database.
OR data types include:
Structs - structured types
Arrays - array types
These types are defined differently in each database, in Oracle they are OBJECT types, VARRAY types, and NESTED TABLE, and REF types.
JDBC standardizes access to OR data types using the Struct, Array and Ref interfaces.
With OR data-types you can have more complex database schemas, such as a TABLE of Employee_Type that has a Varray of Phone_Types and a Ref to it manager.
JPA does not have any direct support for mapping OR data-types, but some providers do.
EclipseLink has support for mapping OR data-types including, Structs, Ref, and Arrays. Custom mappings and annotations are used to map these, but the runtime JPA API is the same.
I would not normally recommend usage of OR data-types, as they are less standard than traditional relational tables, and do not give much benefit. Some database defined OR data-types, such as spatial data-types do offer advantages as they have integrated database support.
See,
http://en.wikibooks.org/wiki/Java_Persistence/Advanced_Topics#Structured_Object-Relational_Data_Types
I would say no. JPA is targeted at RDBMSs, and doesn't use the additional capabilities offered by ORDBMSs.
Now, PostgreSQL is also a very good RDBMS (you're not forced to use its object-oriented features, and my guess would be that most of its users don't), and you may use it with JPA without problem.
JPA is the translator between "thinking in objects" (Java) and "thinking in relations" (SQL). Therefore a JPA implementation will always speak to the DB in terms of relations. "Object Relational" stuff is ignored here.
Ignoring JPA and talking directly to the DB in "ORDBMS" speak won't buy you performance benefits in the most common cases, because ORDBMS are still RDBMS with some glue logic to look a little bit object-stylish. The data is stored in relations, all access paths are the same as pure relational access path.
If you really want to see performance benefits by switching not only the database product but the database technology (or philosophy) you should look at real Object Databases or even NoSQL.
Related
I have just heard about that JPA specification is now available and usable for nosql databases. My question here is, is it the same as the one which we are used to use with relational databases ? because there are many differences between relational and nosql database especially when we talk about transaction which is not the same whatsoever. Did oracle release a new specification that encompasses new changes for nosql databases ?
regards
JPA is defined totally for RDBMS datastores. See Oracles specification.
There are a few of the well known JPA implementations that have extended their support for JPA to also allow some non-RDBMS datastores to be used with the same API (the original one that did this was DataNucleus JPA, but Hibernate and EclipseLink have copied this since). While you can use the same API for persistence, you have to be aware that you make some compromises since the query language in particular is not always suited to non-RDBMS datastores. There are no plans (that I know of) to have a JPA spec for non-RDBMS.
There is a JDO (Java Data Objects) persistence spec that applies to RDBMS and non-RDBMS, and the JDO API is more suited to many different types of datastores.
I have recently started getting familiarized with NoSQL (HBase). I am definitely a noob.
I was investigating about ORMs and high level clients which can be used on HBase and came across a few.
Some ORM libraries like Kundera are providing SQL like data query functionality. I am finding this a little counter intuitive.
Can any one help me understand why we would again need SQL like querying if the whole objective was to move away from it?
Also can anyone comment on your experiences with ORMs for HBase? I looked at a few of them from http://wiki.apache.org/hadoop/SupportingProjects and started looking at Kundera.
Another related question - Does data query with Kundera run map reduce jobs internally?
kundera or Spring data might provide user friendly ORM layer over NoSQL databases, but the underlying entity model still has to be NoSQL friendly. This means that NoSQL users should not blindly follow RDBMS modeling strategies but design ORM entities in such a way so that all NoSQL capabilities can be used.
As a thumb rule, the kundera ORM entities should be designed using query-first strategy where first the queries need to defined so as to create primary keys and also ensuring that relationship model is used as minimal as possible. Querying on random columns and full scans should be avoided and so data might have to be replicated across entities for reducing multiple entity look ups. Also, transactions management needs to be planned. FYI, kundera does not support transactions(beyond single row TX supported by Hbase/Cassandra).
Reason for using Kundera:
1) If looking for SQL like support over HBase. As it is build on top of HBase native API, so it simply transforms these SQL queries in to corresponding GET or PUT method calls.
2) Currently it support HBase-0.20.6 only. Kundera-2.0.6 will enable support for HBase 0-90.x versions.
3) Kundera does not do sometihng out of the box to provide map reduce over SQL like queries. However support for such thing will be provided in Kundera-2.0.6 by enabling support for Hive native queries only!
It is totally JPA compliant, so no need to learn something new. It simply hides complexity at developer level with very minimal effort.
SQL like querying is for developement ease, quick developement, less error prone and reusability ofcourse!
-Vivek
I am fairly new to the noSQL world, and although I understand the benefits of performance and "cloud" friendliness, it seems the RDBMS world is much simpler and standard and limited to fewer players
I worked with SQL Server, Oracle, DB2, Sybase, Terradata, MySQL and others, and it seems they have in common much more (in terms of Query language, Indexing, ACID, etc) than the noSQL family.
My question is mainly this
Is it at all a valid concept to move an existing Spring/Java EE+JPA app to a noSQL storage? or it will require a complete re-architecture of the system beyond the medium of storage?
Hoping it's a valid goal, are there any migration paths that were case studied as best practices?
Is there an equivalent to the concept in "noSQL" that is comparable to ORM for RDBMS? e.g. any layer of separating the storage implementation from concept (I know GAE BigTable supports JDO and JPA but only partially, is there a newer JSR for a more noSQL friendly JPA?)
Are there any attempts to standardize "noSQL" the same way RDBMS are (query language,
API)
Is "noSQL" a too wide term? Should I modify the question per implementation (KV/Document)
Try Kundera : https://github.com/impetus-opensource/Kundera. it is an open source JPA2.0 compliant solution. You can also join http://groups.google.com/group/kundera-discuss/subscribe for further discussion.
-Vivek
DataNucleus allows JPA persistence to RDBMS, MongoDB, HBase and various others. That is one way you can tackle the problem, giving you a start point for use of your app with other datastores. From there you could modify class hierarchies to get around some of the problems that these other datastores bring. Use of JPA with other datastores is not part of any JSR and never will be, since JPA is designed around RDBMS solely. JDO on the other hand is already a standard for all datastores, as it was designed to be (also supported by DataNucleus)
EclipseLink 2.4 supports JPA with MongoDB and other NoSQL data sources.
http://java-persistence-performance.blogspot.com/2012/04/eclipselink-jpa-supports-mongodb.html
PlayOrm is another solution with it's Scalable-SQL and is JPA-like but breaks from JPA in that it supports noSQL patterns that JPA can't support.
I use Zend_Db in some project, I discover Doctrine there is a while but never actually used it.
What are the advantage of Doctrine over Zend_Db ? What are the benefits to use Doctrine ?
By the way, is it easy to use Doctrine with Zend Framework 1.10.7? Integration and use with the other component ? As it doesn't seem to exist a Doctrine Adapter
Thank you
Doctrine is an ORM. It's meant for persisting a rich domain object model to a database and allow querying effectively while maintaining the results as objects. Zend_Db comprises an implementation of the table and row data gateway design patterns, which provide a simple scheme for querying a single table and manipulating its rows. That makes Zend_Db a kind of a lesser cousin of Doctrine, with the latter vastly more powerful and useful while also more complex and resource intensive. If you have a rich domain model with a lot of interrelations, Doctrine is your solution to managing all the complexity. For simple CRUD on simple tables, by all means go for Zend_Db.
You don't need an adapter for Doctrine, you just use it. Several classes in Zend Framework integrate readily with Zend_Db, though - such as validation based on database row existence - and you'll have to cook up your own equivalents. It will take some work but it's not a complex task, and you may be able to find some implementations readily available on the net.
when we say rdbms that means it may be oracle, my sql, ms access etc.. But for dbms what are the examples. Is there any example or it just the concept?.
A DBMS is a database management system. There are two crucial features a DBMS must provide:
storing data
standardised access to the data
The second function is the crucial one. I can connect to a DBMS with a generic client (e.g. through JDBC and discover the organisation of the data stored therein. I can do this because a real DBMS maintains metadata - data about the date it stores - in a data dictionary or an INFORMATION_SCHEMA.
So we can see that flat files do not constitute a DBMS. They handle the first part, persistence, easily enough, but they fail on the second: only the application (or person) which wrote the data can interpret the data structure. This means that spreadsheets don't count as a DBMS either (although a case can be made for XML files).
An RDBMS is a particular type of DBMS which implements Codd's famous Twelve Rules. Many database theoreticians would arge that the products you list (Oracle, MySQL, MS Access) are examples of SQL DBMS rather than RDBMS because they fail to satisfy two or more of Codd's rules: they all fail Rule 0 and then at least one other rule.
There are other types of DBMS. There is the hierarchical form, of which the most venerable is MUMPS . There are object-oriented OODBMS, such as Intersystems Cache. There are network (graph) DBMS e.g. IDMS and Neo4J. And thene there's the whole raft of other NoSQL databases most of which probably qualify as DBMSes.
dbms = database management system
rdbms = relational database management system
So every rdbms is also a dbms.
You might want to name Gemstone, an OODBMS, or Cache, a hierarchical one.
Database management system has a list of links to various types of DBMSs which then link to lists of examples for that type, for example a list of Object DBMSs