Java Reference
In-Depth Information
For simple applications working with only one database and less than 10 relational tables, it is
advised to use JDBC. It's quite easy to install and use when compared to Hibernate, which has a
rather steep learning curve and bigger footprint.
Hibernate is typically recommended when working with complex database models consisting of
hundreds of relational tables with complex relationships between them. One of the key benefits of
Hibernate is that it allows the complex underlying database design to be completely abstracted.
Managing all these tables and relationships in JDBC would be a very cumbersome exercise. Since
many professional software development methodologies are object-oriented, another key advantage
of Hibernate is that it provides a straightforward mapping from a conceptual OO model to a Java
application without having to bother with database design issues. Furthermore, Hibernate is a very
portable solution, making it easy to switch to another ORM if desired. However, a key concern that
is often heard by many Java developers working with ORM frameworks in general is that many
ORMs could benefit from further query optimization and tuning, for example, improved indices
and caching. Because of this performance issue, some developers use a mixed approach, using native
SQL for read operations (which typically make up the majority of an application anyway) and
Hibernate for the remaining create, update, and delete operations.
What's ahead
Nowadays, databases are expanding massively in size. IBM estimates that every day 2.5 quintillion
bytes of data are generated. In relative terms, this means that 90% of the data in the world has been
created in the last two years. New database technologies have been introduced to efficiently cope
with this big data storm. NoSQL (Not only SQL) is one of these newer technologies. NoSQL data-
bases abandon the well-known and popular relational database scheme in favor of a more flexible,
schema-less database structure that more closely aligns with the needs of a big data-generating busi-
ness process. One of its key advantages is that it more easily scales horizontally in terms of storage.
Four popular types of NoSQL database technologies are key-value-based databases, document-
based databases, column-based databases, and graph-based databases. This chapter concludes with
a brief discussion of these technologies.
Key-value-based databases access data by means of keys. In other words, data is stored as a table
with only two columns: a (primary) key and a corresponding value, similar to a dictionary. The
value itself is stored as a meaningless binary large object (blob), and it is the responsibility of the
application to understand its content. An example of a key-value-based database is Amazon's
Dynamo.
Document-based databases are very similar to key-value-based databases except that the value is
now a document. Various document formats can be supported, such as XML, JSON, BSON, PDF,
Microsoft Word, and others. Unlike in key-value-based databases where the values are unstructured,
a document consists of semi-structured elements specified using a predefined set of tags. A very
popular example of a document-based database is MongoDB.
Contrary to classical relational databases where the data is stored row by row, column-based data-
bases store data in a column-by-column format. Every column then contains a name, a value, and
a timestamp (which can be used to verify how recent the data is). A column family then groups
 
Search WWH ::




Custom Search