liveBook · Manning

NoSQL database

As explained in Java Persistence with Spring Data and Hibernate epub

A NoSQL database is a nonrelational database system designed around data models and access patterns other than the traditional relational table model.

A NoSQL database stores data in formats other than relational tables. Its flexible schema allows data to be persisted without fixing the complete schema in advance, supporting applications with rapidly changing requirements. section 18.1

Common NoSQL models include:

  • Document-oriented databases store JSON-like documents; MongoDB organizes them into databases, collections, and documents. section 17.1 section 18.1
  • Graph-oriented databases store nodes and edges, as in Neo4j. section 18.1
  • Key/value databases use map-like keys and values, as in Redis; wide-column stores permit varying column names and formats, as in Apache Cassandra. section 18.1

Persistence frameworks can extend application portability from relational databases to NoSQL systems. Hibernate OGM reuses Hibernate Core, JPA, and JPQL so applications can target MongoDB or Neo4j with configuration changes, although portability can affect execution speed. section 18.0 section 18.1

JPA access to MongoDB

A JPA application can initialize an EntityManagerFactory, begin a transaction, use entityManager.find(User.class, id), and query with JPQL. Hibernate OGM maps these operations to MongoDB, where the persisted entities appear as collections and documents. section 18.2.3

Table 17.1 Compared terminology: RDBMS vs. MongoDB (view table figure)

Relational databases

MongoDB

Database

Database

Table

Collection

Row

Document

Column

Field

Compare relational terminology with MongoDB's database, collection, document, and field model. section 17.1

How Java Persistence with Spring Data and Hibernate epub covers it

How deep it goes
Defines major NoSQL data models and demonstrates JPA transactions, entity lookup, JPQL queries, and resulting MongoDB collections.
Examples
Uses MongoDB documents, Compass filters, JPA entity tests, MongoDB collections, and JPQL queries over users, items, and bids.
What it assumes
Assumes familiarity with relational persistence, JPA, Hibernate, entity managers, and JPQL before applying those abstractions to NoSQL systems.
What you can do after
Apply NoSQL persistence through MongoDB Compass, JPA, JPQL, and Hibernate OGM while preserving transaction boundaries.
How it connects
Connects NoSQL databases with relational databases, document databases, graph databases, key/value databases, wide-column stores, JPA, JPQL, and Hibernate OGM.

Also explained in

Compare how 7 books explain NoSQL database →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Java Persistence with Spring Data and Hibernate epub. The section links point to the parts of the book it draws on.