Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Java EE and NoSQL using JBoss EAP 7 and OpenShift

Java EE and NoSQL using JBoss EAP 7 and OpenShift

  • Login to see the comments

Java EE and NoSQL using JBoss EAP 7 and OpenShift

  1. 1. Java  EE  and  NoSQL   using   JBoss  EAP  7   and   OpenShift Arun Gupta, @arungupta Matt Ingenthron, @ingenthr
  2. 2. • Java EE 7 and Java SE 8 • Optimized for containers & cloud • Enhanced admin & monitoring • DevOps productivity
  3. 3. DEVELOPER PRODUCTIVITY MEETING ENTERPRISE DEMANDS Java EE 7 !  Batch !  Concurrency !  Simplified JMS !  More annotated POJOs !  Less boilerplate code !  Cohesive integrated platform !  WebSockets !  JSON !  Servlet 3.1 NIO !  REST
  4. 4. Top 10 Java EE 7 features • WebSocket endpoints • Batch Applications • JSON Processing • Concurrency Utilities • Simplified JMS API • Transactions in POJO • JAX-RS Client API • Default Resources • More annotated POJOs • Faces Flow
  5. 5. Optimized for Container & Clouds • Low-memory footprint, faster startup and higher density • OpenShift Container support • Highly scalable Web Server (Undertow) • Non/blocking I/O • Port reduction • HTTP/2, WebSockets, …
  6. 6. Enhanced Admin & Monitoring • Faster, simpler, intuitive web console • Powerful CLI • Server suspend/Graceful shutdown
  7. 7. Types of NoSQL databases • Key/Value • Document • Graph • Columnar
  8. 8. NoSQL Databases: Key-Value Key Value Email devadvocates@couchbase.com Profile {
 “name”: “Bob”, “location”: “Mountain View, CA” } Logo
  9. 9. NoSQL Databases - Document {
 “name”: “Erlich”, “location”: “Mountain View, CA”,
 “like”: [
 “running”,
 “reading”, “music”
 ] } {
 “name”: “Gilfoyle”, “location”: “Mountain View, CA”,
 “like”: [
 “running”,
 “reading”, “music”
 ] } {
 “name”: “Dinesh”, “location”: “Mountain View, CA”,
 “like”: [
 “running”,
 “reading”, “music”
 ] } {
 “name”: “Richard”, “location”: “Silicon Valley”,
 “like”: [
 “running”,
 “reading”, “music”
 ] }
  10. 10. NoSQL Databases - Columnar Row Column1 JK Rowling Harry Potter and the Philosopher’s Stone Column2 Author Title Year of Release Harry Potter and the Chamber of Secrets Harry Potter and the NoSQL Journey 1997 1998 2016
  11. 11. NoSQL Databases - Graph Richard Hendricks Pied Piper Erlich Bachman House ownsworks founded part-owner friends
  12. 12. ©2016  Couchbase  Inc. NoSQL  catalog 12 Key-Value Memcached Cache
 (memoryonly) Database
 (memory/disk) Redis Data Structure Riak Couchbase MongoDB Document Column Cassandra Graph Neo4j HBase InfiniteGraph Coherence Membase
  13. 13. ©2016  Couchbase  Inc. What  is  Couchbase? 13 Managed'Cache Key-Value'Store Document'Database Embedded'Database Sync'Management
  14. 14. ©2016  Couchbase  Inc. Couchbase  Developer 14
  15. 15. ©2016  Couchbase  Inc. Couchbase  and  BigData 15
  16. 16. ©2016  Couchbase  Inc. Cross-­‐data  Center  Replication  (XDCR) 16
  17. 17. ©2016  Couchbase  Inc. ▪Declarative query language that extends SQL for JSON ▪SELECT, INSERT, UPDATE, DELETE, MERGE, EXPLAIN ▪Sort, filter, transform, group, and combine/join data ▪Query data via language integration 17
  18. 18. ©2016  Couchbase  Inc. ▪JSON documents – Rich structure – Structure evolution ▪SQL – General query functionality – Query across relationships ▪Why N1QL? – Developers already know SQL – No need for complex query frameworks 18
  19. 19. ©2016  Couchbase  Inc. SELECT name, code
 FROM `beer-sample`
 WHERE city = 'San Francisco'
 AND type = 'brewery'; 19 SELECT DISTINCT brewery_id FROM `beer-sample` WHERE brewery_id IS NOT MISSING 
 ORDER BY brewery_id LIMIT 5;
  20. 20. ©2016  Couchbase  Inc. Couchbase  Java  SDK //connect to the cluster CouchbaseCluster cluster = CouchbaseCluster.create("localhost"); //open a bucket Bucket bucket = cluster.openBucket(“bucket", "password"); //create JSON and a document JsonObject json = JsonObject.create().put("name", "John"); JsonDocument doc = JsonDocument.create("key1", json); //store the document bucket.insert(doc); 20
  21. 21. ©2016  Couchbase  Inc. Access  NoSQL  using  JDBC ▪JDBC driver for accessing Couchbase ▪Run N1QL queries ▪Get JSON data through standard JDBC interfaces ▪JSON types supported – Simple values (string, numbers, boolean, …) – Compound (objects, arrays, …) ▪Users – BI/ETL Tools (Tableau, Informatica, …) – Persistence providers (EclipseLink, Hibernate, …) ▪github.com/jdbc-json/jdbc-cb 21
  22. 22. ©2016  Couchbase  Inc. Getting  Started  with  JDBC  Driver <dependency> <groupId>com.couchbase.jdbc</groupId> <artifactId>jdbc-n1ql</artifactId> <version>1.0-BETA</version> </dependency> 22
  23. 23. ©2016  Couchbase  Inc. Accessing  Couchbase  using  JDBC package com.couchbase.jdbc.examples; import java.sql.*;
 public class SimpleVerification { public static void main(String[] args) throws Exception { Connection con = DriverManager.getConnection("jdbc:couchbase://localhost:8093"); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("select name, code from `beer-sample` " + "where city = 'San Francisco' and type = 'brewery'"); while (rs.next()) { String name = rs.getString("name"); String code = rs.getString("code"); System.out.println("name: " + name + ", code: " + code); } } } 23
  24. 24. ©2016  Couchbase  Inc. Hibernate  OGM ▪Power and simplicity of JPA for NoSQL databases ▪Currently supported – Key/value: Infinispan, Ehcache – Document: MongoDB, Couchbase – Graph: Neo4J ▪hibernate.org/ogm 24
  25. 25. Community Powered Innovation
  26. 26. OpenShift 3
  27. 27. ©2016  Couchbase  Inc. 28
  28. 28. ©2016  Couchbase  Inc. ▪Technical readiness for OpenShift ▪First and only NoSQL database primed for OpenShift 29
  29. 29. ©2016  Couchbase  Inc. OpenShift  All-­‐in-­‐One  VM 30
  30. 30. ©2016  Couchbase  Inc. 31
  31. 31. ©2016  Couchbase  Inc. 32
  32. 32. ©2016  Couchbase  Inc. WildFly  Swarm ▪Package and run Java EE applications ▪Just enough of the server runtime ▪Creates an über JAR ▪Integrated stack – Single sign-on using Keycloak – Monitoring using Hawkular – Swagger – Netflix OSS stack - Hystrix, Turbine, … 33
  33. 33. ©2016  Couchbase  Inc. Java  EE  Microservices  Stack 34 https://github.com/arun-gupta/wildfly-swarm-couchbase
  34. 34. ©2016  Couchbase  Inc. 35 @Path("airline") public class AirlineResource { @Inject Database database; @GET public String getAll() { N1qlQuery query = N1qlQuery.simple("SELECT * FROM `travel-sample` LIMIT 10"); N1qlQueryResult result = database.getBucket().query(query); return result.allRows().toString(); } } @Singleton @Startup public class Database { CouchbaseCluster cluster; public CouchbaseCluster getCluster() { return CouchbaseCluster.create(“localhost”); } public Bucket getBucket() { return getCluster().openBucket("travel-sample"); } }
  35. 35. ©2016  Couchbase  Inc. Demo 36
  36. 36. ©2016  Couchbase  Inc. References ▪JBoss EAP: jboss.org/products/eap ▪OpenShift: openshift.com ▪Getting Started with NoSQL: couchbase.com/get-started- developing-nosql ▪Couchbase Developer Portal: developer.couchbase.com ▪N1QL interactive tutorial: query.pub.couchbase.com/tutorial/ 37
  37. 37. ©2016  Couchbase  Inc.

×