Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Spring Data - Persistence made easy

Spring Data - Persistence made easy

Talk Presented at the NYC Spring User Group December 1st, 2015
http://www.meetup.com/NYC-SUG/events/226834890/

Mark Pollack

December 01, 2015
Tweet

More Decks by Mark Pollack

Other Decks in Programming

Transcript

  1. 2 Where I’m coming from… Big Physics -> Big Data

    • ‘90s @ BNL/FNAL/CERN/INFN Finance • TIBCO, Reuters, CodeStreet OpenSource • SpringSource -> VMware -> Pivotal • Spring Framework & Spring.NET – 2004 • Spring Data – 2010 • Spring XD – 2012 • Spring Cloud Data Flow -2015
  2. 4 Timeline 2005 2015 1.2.x HibernateTemplate JdbcTemplate TransactionManager DAO Exceptions

    2010 2007 2008 Redis 1.0 Mongo1.0 Cassandra 0.6 Neo4j Hadoop 0.15 2009 2006 2011 2012 2013 2014 Spring Data Key-value Document Graph Spring Gemfire Spring Hadoop Spring Cloud Data Flow Spring Data Codd, Dijkstra, Evans +REST, Cassandra Couchbase, ElasticSearch Spring XD Spring Boot JPA 2.0 Hades 3.0.x Spring Data Redis, Mongo Neo4j, JPA (Repositories!) 3.2.x Spring Data Aurora, Babbage (Release Train!) +Solr, Gemfire 4.0.x Spring Data Fowler Gosling 4.2.x JPA 1.0 2.0.x Grails1.0 Roo 1.0
  3. 8 Spring Data Modules Core Neo4j Gemfire JPA Solr Elasticsearch

    REST Cassandra Couchbase Redis MongoDB Community modules Core modules KeyValue
  4. 9 The Structure of a Spring Data Module where needed

    where needed where reasonable Templates Object Mapping Repositories Spring Container Integration CDI Support
  5. 10 Spring Data’s Goal “… provide a familiar and consistent,

    Spring-based programming model while retaining store-specific features and capabilities.
  6. 11 Spring Data Repositories Spring XD Lots of boiler plate

    code in writing Hibernate DAOs Why always writing SQL/JPQL for finders? • Rails, Grails… • Goal : Avoid code generation What about new query languages? CQL, Mongo QL?
  7. 12 Spring Boot – Data Access Autoconfiguration Spring XD Driver,

    connection pool • Use well known properties (driver, pool) • Tomcat pooling prefered, but can use HikariCP and Common DBCP(2) Database migrations • Flyway and Liquibase @EntityScan by default vs. persistence.xml Embedded database • H2 + H@ Console, HSQL, Derby Spring Data Repositories
  8. 14 REST APIs must be hypertext-driven “I am getting frustrated

    by the number of people calling any HTTP-based interface a REST API. Today’s example is the SocialSite REST API. That is RPC. It screams RPC. There is so much coupling on display that it should be given an X rating.
  9. 15 REST APIs must be hypertext-driven “What needs to be

    done to make the REST architectural style clear on the notion that hypertext is a constraint? In other words, if the engine of application state (and hence the API) is not being driven by hypertext, then it cannot be RESTful and cannot be a REST API. Period. Is there some broken manual somewhere that needs to be fixed? - Roy Fielding 2008