• 270 likes • 519 Views
Building Oracle NoSQL Database Applications with EclipseLink. Robert Greene: Oracle NoSQL Database John Bracken, Shaun Smith: EclipseLink.
E N D
Building Oracle NoSQL Database Applications with EclipseLink Robert Greene: Oracle NoSQL Database John Bracken, Shaun Smith: EclipseLink
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Program Agenda • Oracle NoSQL Database • Architecture, value proposition, key features • EclipseLink for NoSQL • JPA-style API for NoSQL Databases • RESTful services for JPA • Deep Dive—EclipseLink NoSQL for ONDB
NoSQL Where did it come from and What is it? Big Data Better Program Management, Just in Time Manufacturing, Social Mktng Basic Data (accounts, contacts, inventory, employees) Technology NoSQL Competition Modern Data (social data, public data, streaming data machine data) Smart & Agile Business Traditional Business New Data Use requiring New Data Management New Data, React Faster
Logical Architecture – Applications View Application NoSQL Driver • Elastic partitions (split, add, contract) • Reads from any node in system Partition Partition Partition • Writes to elected node D D D R R R R R R Store
Physical Architecture Application NoSQL Driver Data Center Data Center Data Center • Isolated replicas for always-on availability Zone 3 Zone 1 Zone 2 R D R D R R D Disks R • Intelligent latency selective reads from any node • Elected Master for TXN ops R D R Servers Racks Net Switches
Oracle NoSQL Database • Scalable, Highly Available, Key-Value Database Application Application Application Application NoSQL DB Driver NoSQL DB Driver • Flexible Key-Value Data Model • ACID transactions • Horizontally Scalable • Highly Available • Elastic Configuration • Simple administration • Intelligent Driver • Commercial grade software and support • Features Storage Nodes Datacenter A Storage Nodes Datacenter B • Java SE 6 (JDK 1.6.0 u25)+; Solaris or Linux
Oracle NoSQL Database Fully integrated for the Enterprise Application MapReduce, OLH, ODC, ODI NoSQL DB Driver External Tables Real Time Access GRAPH
Developing Applications Data Modeling • Major-Minor ( hash – local ) • Keep small ( memory ), align with queries Strings picture .jpg Byte Array userid Major key: subscriptions address Minor key: Value: expiration date email id phone #
Developing Applications Value Types Data Modeling UUID = Range Value Type Qualifier Subject – ID Range = Array of Int LF 123-PS3234 PS Timestamp psi, irate – The Value a List What Sensor ID Left Front Pressure Sensor A range of sensor measures All measures of a sensor Queries A specific sensor sensors by section
JSON Data Format Avro Based Serialization/DeSerialization of the Value • Why Avro? • Compact, highly efficient serialization • Synergy with Hadoop • Schema • DDL allows schema creation through Avro JSON definition • Supports serialization from/to JSON strings • Schema evolution • Easy to use mechanism for schema evolution • Schema versions can be opaque to readers
Developing Applications Abstracting the Data Modeling Challenge • Feature Advantages Delivered • Seamless development paradigm between Relational and NoSQL • Annotation based persistence configuration • Transparent management of inter value references ( 1 to 1 ) • Transparent management of intra value references ( Embedded ) • Caching of data access via EclipseLink 2nd level cache
Java Persistence—The Problem Space <customer id=“…”> <name>…</name> <contact-info> … </contact-info> </customer> CUST JAXB ID NAME C_RATING Relational Customer XML id: int name: String creditRating: int JPA ? Java … NoSQL JPA: Java Persistence APIJAXB: Java Architecture for XML BindingDBWS: EclipseLink Database WebServices
JPA - Background • A standardization of industry practices for Java POJO Object Relational Persistence • Suitable for use in different modes • Standalone in Java SE environment • Hosted within a Java EE Container • Merging of expertise from persistence vendors and communities including: TopLink, Hibernate, JDO, EJB vendors and individuals
Java Persistence API (JPA) - in a Nutshell Defines: • How Java objects are stored in relational db • A programmer API for reading, writing, and querying persistent Java objects (“Entities”) • A full featured query language in JP QL • a container contract that supports plugging any JPA runtime in to any compliant container Java SE/EE Application Java Classes JPA Provider JDBC Driver PersistenceDescriptors Database Schema
EclipseLink Project www.eclipse.org/eclipselink • Founded by open sourcing Oracle TopLink at Eclipse Foundation • Object-Relational: Java Persistence API (JPA) • JPA 1.0, 2.0, and 2.1 compliant • EclipseLink is JPA 2.0 & 2.1 Reference Implementation • Sophisticated L2 and Clustered Caching Infrastructure • Object-XML: Java Architecture for XML Binding (JAXB) • JAXB 2.2 Certified Implementation • Additional features include: JSON Binding, DBWS, & JPA-RS
JPA-RS GET http://.../persistence/Accounting/Invoice/... JAX-RS http://.../persistence/Accounting/Invoice/...mapped to JPA-RS service JAX-RS JPA JPA-RS JPA-RS maps URI http://.../persistence/Accounting/Invoice/... to Accounting PU and Invoice entity Accounting PU Human Resources PU Contracting PU ...
JPA-RS Features • Access database data through REST with JSON or XML • Provides REST operations for entities in persistence unit (GET, PUT, POST, DELETE) • Automatic generation of XML and JSON bindings • Supports invocation of named queries via HTTP • Server Caching—EclipseLink clustered cache
NoSQL Databases Challenges • No common definition (document, graph, columnar) • Differing feature sets • Some offer query language/API—some not • No standards • Every database offers a unique API • Cost in terms of learning • Zero portability across databases
EclipseLink NoSQL • Support JPA-style access to NoSQL databases • Leverage non-relational database support for JCA (and JDBC when available) • Define annotations and XML to identify NoSQL stored entities (e.g., @NoSQL) • Support JPQL subset for each • Key principal: leverage what’s available • Initial support for MongoDB and Oracle NoSQL
Applicability of JPA to NoSQL • Core JPA concepts apply to NoSQL: • Persistent Entities, Embeddables, ElementCollection, OneToOne, OneToMany, ManyToOne, Version, etc. • Some concepts apply sometimes: • JPQL, NamedNativeQuery • Pure relational concepts don’t apply: • CollectionTable, Column, SecondaryTable, SequenceGenerator, TableGenerator, etc.
EclipseLink NoSQL for ONDB Challenges • Mapping Major Keys • Avro Serialization and Mapping • Native Minor Key Mapping • Querying
EclipseLink NoSQL for ONDB Deep Dive