Spring Data: Modern Data Access for Enterprise Java – #java #bookreview

Spring Data: Modern Data Access for Enterprise Java
Mark Pollack, Oliver Gierke, Thomas Risberg, Jonathan L. Brisbin and Michael Hunger
(O’Reilly, paperbackKindle)

Big Data keeps getting wider and deeper by the second. And so do the demands for analyzing and profiting from all of those piled-up terabytes.

Meanwhile, the once whiz-bang technology known as the relational database is having a very hard time keeping pace. The sheer amount of data that companies now gather, store, access, and analyze is pushing traditional relational databases to the breaking point.

Many Java developers who are trying to keep these overloaded systems held together with baling wire, also are starting to learn to work with some of the “alternative data stores that are being used in mission-critical enterprise applications,” the authors of Spring Data point out.

A lot of data now is being stored elsewhere and not in relational databases. Yet companies cannot abandon what they have already gathered and invested heavily to access. So they need to keep using and supporting their relational databases, plus some newer, faster, more voracious solutions lumped under the heading “NoSQL databases,” (even though you can query them).

In “the new data access landscape,” the authors note: “there is a revolution taking place, which for data geeks is quite exciting. Relational databases are not dead; they are still central to the operations of many enterprises and will remain so for quite some time. The trends, though, are very clear: new data access technologies are solving problems that traditional relational databases can’t, so we need to broaden our skill set as developers and have a foot in both camps.”

They add: “The Spring Framework has a long history of simplifying the development of Java applications, in particular for writing RDBMS-based data access layers that use Java database connectivity (JDBC) or object-relational mappers.”

Their new book “is intended to give you a hands-on introduction to the Spring Data project, whose core mission is to enable Java developers to use state-of-the-art data processing and manipulation tools but also use traditional databases in a state-of-the-art manner.”

They have organized their 288-page book into six parts and 14 chapters:

Part I – Background

  • Chapter 1 – The Spring Data Project
  • Chapter 2 – Repositories: Convenient Data Access Layers
  • Chapter 3 – Type-Safe Querying Using Querydsl

Part II – Relational Databases

  • Chapter 4 – JPA Repositories
  • Chapter 5 – Type-safe JDBC Programming with Querydsl SQL

Part III – NoSQL

  • Chapter 6 – MongoDB: A Document Store
  • Chapter 7 – Neo4j: A Graph Database
  • Chapter8 – Redis: A Key/Value Store

Part IV – Rapid Application Development

  • Chapter 9 – Persistence Layers with Spring Roo
  • Chapter 10 – REST Repository Exporter

Part V – Big Data

  • Chapter 11 – Spring for Apache Hadoop
  • Chapter 12 – Analyzing Data with Hadoop
  • Chapter 13 – Creating Big Data Pipelines with Spring Batch and Spring Integration

Part 5 – Data Grids

  • Chapter 14 – GemFire: A Distributed Data Grid

“Many of the values that have made Spring the preferred platform for enterprise Java developers deliver particular benefit in a world of fragmented persistence solutions,” states Ron Johnson, creator of Spring Framework. Writing in the book’s foreword, he notes: “Part of the value of Spring is how it brings consistency (without descending to a lowest common denominator) in its approach to different technologies with which it integrates.

“A distinct ‘Spring way’ helps shorten the learning curve for developers and simplifies code maintenance. If you are already familiar with Spring, you will find that Spring Data eases your exploration and adoption of unfamiliar stores. If you aren’t already familiar with Spring, this is a good opportunity to see how Spring can simplify your code and make it more consistent.”

Spring Data definitely is not light reading, but it is well-written, and provides a good blending of procedures, steps, explanations, code samples, screenshots and other illustrations.

Si Dunn

MongoDB and PHP – Document-oriented data for web developers – #bookreview #in #programming

MongoDB and PHP
By Steve Francia
(O’Reilly,
paperback, list price $19.99; Kindle edition, list price, $14.99)

You can’t blame Steve Francia for being vocal in his praise for MongoDB®. He’s the chief solutions architect at 10gen, Inc., which develops and supports this well-respected document-oriented database.

One consequence of the current, explosive growth of social media is that “all data and experience [needs] to be personalized – on a large scale,” he writes in his new book, MongoDB and PHP. Today, the data stores and caching techniques used over in the past three decades are losing their ability to keep pace. So: “It was out of this need that MongoDB was created. A database for today’s applications, a database for today’s challenges, a database for today’s scale.”

MongoDB, according to its 10gen, Inc., website, is “a scalable, high-performance, open-source noSQL database,” written in C++. Its features include: document-oriented storage; full index support; replication and high availability; auto-sharding (horizontal scaling with a partitioning architecture); querying; rapid in-place updates; map/reduce (for batch processing of data and aggregation); and GridFS (a specification for storing large files in MongoDb).

Francia explains that MongoDB is a document database. “At the highest level of organization, it is quite similar to a relational database, but as you get closer to the data itself, you will notice a significant change in the way the data is stored. Instead of databases, tables, columns, and rows, you have databases, collections, and documents.”

Meanwhile, in PHP (PHP: Hypertext Processor), “a document is equivalent to an array …,” for all intents and purposes.

PHP, which can be downloaded from this site, “is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML,” according to the PHP Group.

Francia notes in his book that “[i]n MongoDB, the primary object is called a document. A document doesn’t have a direct correlation in the relational world. Documents do not have a predefined schema like relational database tables. A document is partly a row, in that it’s where the data is located, but it’s also part columns, in that the schema is defined in each document (not table-wide)….The best way to think of a document is as a multidimensional array.”

Meanwhile, Francia adds: “Documents map extremely well to objects and other PHP data types like arrays and even multidimensional arrays.” So PHP users contemplating building PHP applications with MongoDB will find that “the PHP array has the closest correlation of any data type. It’s nearly a 1-to-1 correlation.”

His code examples, illustrations and succinct paragraphs show how MongoDB and PHP can work together closely and effectively when building database applications.

If you have been contemplating diving into PHP and/or MongoDB, this is a worthy book to add to your learning and reference collections.

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. He also is a former newspaper and magazine photojournalist. His latest book is Dark Signals, a Vietnam War memoir available soon in paperback. He is the author of a detective novel, Erwin’s Law, a novella, Jump, and several other books and short stories.