O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]

480 visualizações

Publicada em

Let’s be honest: the amount of data collected by applications nowadays is growing at a scary pace. Many of them need to handle billions of users generating and consuming data at an incredible speed. Maybe you are wondering how to create an application like this? What is needed? What benefits can you take from this reality to your project? This session shows how Jakarta EE can meet these needs when you’re working with NoSQL databases in the cloud. It's the same approach used by some of the biggest companies in the world to store, analyze, and get results from really crazy amounts of data. No matter your project size, you can take it to the next level today.

Publicada em: Tecnologia
  • Seja o primeiro a comentar

Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]

  1. 1. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Jakarta EE Meets NoSQL at the Cloud Age Elder Moraes, Developer Advocate, Oracle Otavio Santana, Sr Software Engineer, Tomitribe October, 2018
  2. 2. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement 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. 2
  3. 3. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
  4. 4. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | "The reports about my death are a little exaggerated" - Java EE
  5. 5. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Why Java EE isn't dead
  6. 6. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
  7. 7. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Ok, ok... ...now talk about Jakarta EE
  8. 8. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
  9. 9. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | • What has been moved from Oracle to Eclipse • Specifications • APIs • RIs • TCKs • What won't be moved • Trademark (that's why the name changed) Roadmap
  10. 10. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Roadmap https://www.eclipse.org/ee4j/status.php • 20% - Project Proposal • 40% - Project commiters and resources provisioned • 60% - Initial contribution to the Eclipse IP team • 80% - Initial contribution pushed to Github • 100% - First release review *Ref.: October, 22, 2018
  11. 11. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
  12. 12. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Cloud Native Applications • Uses approaches like microservices, services meshes, immutable infrastructure and declarative APIs • Dynamically orchestrated in modern environments (public, private and hybrid clouds) • Resilient, manageable and observable • Frequent and predictable changes with minimal impact (through automation)
  13. 13. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
  14. 14. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | NoSQL 01 Database 02 Doesn't use structure 03 Not Transaction 04 Base Five different types05
  15. 15. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Key Value AmazonDynamo AmazonS3 Redis Hazelcast Apollo Ares Aphrodite Sun War Love Beauty
  16. 16. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Column Family Apollo Aphrodite Ares Kratos Duty Duty Duty Dead Gods Love, happy Sun War 13 Color weapon Sword Row-key ColumnsHBase Scylla SimpleDb Cassandra DynamoDB Clouddata
  17. 17. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Document { "name":"Diana", "duty":[ "Hunt", "Moon", "Nature" ], "siblings":{ "Apollo":"brother" } } ApacheCouchDB MongoDB Riak Couchbase
  18. 18. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Graph Apollo Ares Kratos was killed by was killed by killed killed Neo4j InfoGrid Sones HyperGraphDB
  19. 19. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
  20. 20. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Multi-Model 01 02 03 04 OrientDB (graph, document) Couchbase (key value, document) Elasticsearch (document, graph) ArangoDB (column family, graph, key-value)
  21. 21. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Scalability vs Complexity Scalability Complexity key-value Column Document Graph
  22. 22. CAP
  23. 23. SQL vs NoSQL SQL KEY-VALUE COLUMN DOCUMENTS GRAPH Table Bucket Column family Collection Row Key/value pair column Documents Vertex Column Key/value pair Key/value pair Vertex and Edge property Relationship Link Edge
  24. 24. Relational Application NoSQL Application Logic Tier Logic Tier DAO DAO JPAJPAJPAJPA JDBC JDBCJDBCJDBC Data Tier APIAPI API Data Tier
  25. 25. The Current Solution DAO Solution Solution Hibernate OGM TopLink
  26. 26. JPA problem for NoSQL 01 02 03 04 05 06 Saves Async Async Callback Time to Live (TTL) Consistency Level SQL based Diversity in NoSQL
  27. 27. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Eclipse JNoSQL DIANA ARTEMIS JNoSQL DAO Mapping Communication Column Documents Key Graph Data Tier 01 02 03 04 Mapping API Communication API No lock-in Divide and Conquer
  28. 28. Communication Issue ODocument document = new ODocument(“collection”); document.field(name, value); JsonObject jsonObject = JsonObject.create(); jsonObject.put(name, value); BaseDocument baseDocument = new BaseDocument(); baseDocument.addAttribute(name, value); Document document = new Document(); document.append(name, value);
  29. 29. Eclipse JNoSQL DocumentEntity entity = DocumentEntity.of("collection"); entity.add(name, value);
  30. 30. Annotated Entities 01 02 03 Mapped Superclass Entity Column @Entity("god") public class God { @Column private String name; @Column private long age; @Column private Set<String> powers; }
  31. 31. Template God artemis = ...; DocumentTemplate template = … template.insert(artemis); template.update(artemis); DocumentQuery query = ... List<God> gods = template.select(query);
  32. 32. Repository interface GodRepository extends Repository<God, String> { Optional<God> findByName(String name); Stream<God> findByNameAndAgeOrderByName(String name, Integer age); }
  33. 33. We have Query by Text List<Movie> movies = documentTemplate.query("select * from Movie where year > 2012"); List<Person> people = columnTemplate.query("select * from Person where age = 25"); Optional<God> god = keyValueTemplate.query("get 'Diana'"); List<City> cities = graphTemplate.query("g.V().hasLabel('City')");
  34. 34. We have Query by Text PreparedStatement preparedStatement = template.prepare("select * from Person where name = @name"); preparedStatement.bind("name", "Ada"); List<Person> adas = preparedStatement.getResultList(); //to graph just keep using gremlin PreparedStatement prepare = graphTemplate().prepare("g.V().hasLabel(param)"); prepare.bind("param", "Person"); List<Person> people = preparedStatement.getResultList();
  35. 35. We have Query by Text interface PersonRepository extends Repository<Person, Long> { @Query("select * from Person") Optional<Person> findByQuery(); @Query("select * from Person where id = @id") Optional<Person> findByQuery(@Param("id") String id); }
  36. 36. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
  37. 37. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Demo time!!!
  38. 38. NoSQL Providers
  39. 39. JUGs/Communities
  40. 40. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | http://cloudnative.eldermoraes.comhttp://bit.ly/dev6109 Jakarta EE Meets NoSQL at the Cloud Age [DEV6109] @otaviojava @elderjava
  41. 41. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Thank you!!!

×