Successfully reported this slideshow.
Your SlideShare is downloading. ×

[JOI] TOTVS Developers Joinville - Java #1

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 74 Ad

[JOI] TOTVS Developers Joinville - Java #1

Download to read offline

Apresentação do meetup "[JOI] TOTVS Developers Joinville - Java #1" que ocorreu dia 07/08/2019.

** Novidades Java, GraalVM e Quarkus
** Do zero à nuvem com Java e Kubernetes

Apresentação do meetup "[JOI] TOTVS Developers Joinville - Java #1" que ocorreu dia 07/08/2019.

** Novidades Java, GraalVM e Quarkus
** Do zero à nuvem com Java e Kubernetes

Advertisement
Advertisement

More Related Content

Slideshows for you (20)

Similar to [JOI] TOTVS Developers Joinville - Java #1 (20)

Advertisement

Recently uploaded (20)

[JOI] TOTVS Developers Joinville - Java #1

  1. 1. 1
  2. 2. 2 Allan Rodrigo Leite Product Manager - TOTVS
  3. 3. 3 Novidades Java, GraalVM e Quarkus 01
  4. 4. 4Who we are 4 Winston Spencer Sonnesen Product Owner - TOTVS Jeferson Francisco Research & Developer Engeneering - fluig Thiago Almeida Weber Software Architect - TOTVS
  5. 5. 5 Licenciamento Java e OpenJDK
  6. 6. 6Licenciamento do Java Java 8 e anteriores A cada 3 anos mais ou menos era lançada uma nova versão • Demora na entrega de novas funcionalidades • Demora na correção de bugs Fim das atualizações públicas • Janeiro/2019 - Uso comercial • Dezembro/2020 Fonte: https://www.oracle.com/technetwork/java/java-se-support-roadmap.html
  7. 7. 7Licenciamento do Java Java 9 e posteriores Lançado em Setembro/2017 • Lançamento de uma nova versão a cada 6 meses Features Releases • Versões maiores onde são disponibilizados novos recursos da linguagem Updates Releases • Acontecem 2x dentro do período • Atualizações de segurança • Correções de bugs Fonte: https://www.oracle.com/technetwork/java/java-se-support-roadmap.html
  8. 8. 8Mais confuso do que o John Travolta com máscara do Nicolas Cage
  9. 9. 9Oracle OpenJDK Builds http://jdk.java.net
  10. 10. 10AdoptOpenJDK Builds 10 http://adoptopenjdk.net
  11. 11. 11Além da JVM da Oracle Amazon Corretto • Distribuição gratuita • Multiplataforma • Pronto para produção do Open Java Development Kit (OpenJDK) • Inclui suporte de longo prazo • Amazon utiliza o Corretto internamente em milhares de serviços de produção • Certificado como compatível com o padrão Java SE Fonte: https://aws.amazon.com/pt/corretto/
  12. 12. 12Além da JVM da Oracle Eclipse OpenJ9 • Mantido pela IBM e pela comunidade • Suporte multiplataforma • Alto desempenho • Sem custo Fonte: https://projects.eclipse.org/projects/technology.openj9/who
  13. 13. 13The Future of Java EE • Oracle contributed GlassFish and the Java EE APIs and TCKs to Jakarta EE • The Jakarta EE Working Group was formed and supporting committees to provide governance to the community and facilitate collaboration. • The Eclipse Foundation Specification Process was created, and customization created and approved for the Jakarta EE Specification Process. • Specification projects are being created and work is underway now within the community to deliver the Jakarta EE 8 release later this year. • javax.* namespace was moved to the jakarta.* namespace
  14. 14. 14 Eclipse MicroProfile What is Eclipse MicroProfile
  15. 15. 15Community - individuals, organizations and vendors
  16. 16. 16Current MicroProfile implementations
  17. 17. 17Sep, 2016 MicroProfile 1.0 JAX-RS 2.0JSON-P 1.0CDI 1.2
  18. 18. 18Aug, 2017 JAX-RS 2.0JSON-P 1.0CDI 1.2 Config 1.0 MicroProfile 1.1 = No change from last release = New
  19. 19. 19Sep, 2017 = Updated = No change from last release = New JAX-RS 2.0JSON-P 1.0CDI 1.2 Config 1.1 Fault Tolerance 1.0 JWT Propagation 1.0 Health Check 1.0 Metrics 1.0 MicroProfile 1.2
  20. 20. 20Jan, 2018 JAX-RS 2.0JSON-P 1.0CDI 1.2 Config 1.2 Fault Tolerance 1.0 JWT Propagation 1.0 Health Check 1.0 Metrics 1.1 Open Tracing 1.0 Open API 1.0 Rest Client 1.0 MicroProfile 1.3 = Updated = No change from last release = New
  21. 21. 21Jun, 2018 JAX-RS 2.0JSON-P 1.0CDI 1.2 Config 1.3 Fault Tolerance 1.1 JWT Propagation 1.1 Health Check 1.0 Metrics 1.1 Open Tracing 1.1 Open API 1.0 Rest Client 1.1 MicroProfile 1.4 = Updated = No change from last release = New
  22. 22. 22Jun, 2018 JAX-RS 2.1JSON-P 1.1CDI 2.0 Config 1.3 Fault Tolerance 1.1 JWT Propagation 1.1 Health Check 1.0 Metrics 1.1 Open Tracing 1.1 Open API 1.0 Rest Client 1.1 JSON-B 1.0 MicroProfile 2.0 = Updated = No change from last release = New
  23. 23. 23Oct, 2018 JAX-RS 2.1JSON-P 1.1CDI 2.0 Config 1.3 Fault Tolerance 1.1 JWT Propagation 1.1 Health Check 1.0 Metrics 1.1 Open Tracing 1.2 Open API 1.0 Rest Client 1.1 JSON-B 1.0 MicroProfile 2.1 = Updated = No change from last release = New
  24. 24. 24Jan, 2019 JAX-RS 2.1JSON-P 1.1CDI 2.0 Config 1.3 Fault Tolerance 2.0 JWT Propagation 1.1 Health Check 1.0 Metrics 1.1 Open Tracing 1.3 Open API 1.1 Rest Client 1.2 JSON-B 1.0 MicroProfile 2.2 = Updated = No change from last release = New
  25. 25. 25Jun, 2019 JAX-RS 2.1JSON-P 1.1CDI 2.0 Config 1.3 Fault Tolerance 2.0 JWT Propagation 1.1 Health Check 2.0 Metrics 2.0 Open Tracing 1.3 Open API 1.1 Rest Client 1.3 JSON-B 1.0 MicroProfile 3.0 = Updated = No change from last release = New
  26. 26. 26How to start with MicroProfile
  27. 27. GraalVMTM Run Programs Faster Anywhere https://www.graalvm.org/
  28. 28. 28 “One VM to rule them ALL…” GraalVM POLYGLOT Zero overhead interoperability between programming languages allows you to write polyglot applications and select the best language for your task. NATIVE Native images compiled with GraalVM ahead-of-time improve the startup time and reduce the memory footprint of JVM-based applications. DEFINITION GraalVM is a universal virtual machine for running applications written in JavaScript, Python, Ruby, R, JVM-based languages like Java, Scala, Groovy, Kotlin, Clojure, and LLVM-based languages such as C and C++. EMBEDDABLE GraalVM can be embedded in both managed and native applications. There are existing integrations into OpenJDK, Node.js and Oracle Database. Top 10 Things To Do With GraalVM
  29. 29. 29 Components: - SDK - Compiler - Truffle - Tools - Substrate VM - Sulong - TRegex - VM GraalVM STARTUP TIME PEAK THROUGHPUT MAX LATENCYMEMORY FOOTPRINT PACKAGING SIZE
  30. 30. Is a framework that allows ahead-of-time (AOT) compilation of Java applications under closed-world assumption into executable images or shared objects (ELF-64 or 64-bit Mach-O). SUBSTRATE VM https://github.com/oracle/graal/tree/master/substratevm
  31. 31. 31VM parameters
  32. 32. Q U A R K U SSupersonic Subatomic Java https://quarkus.io/
  33. 33. 33Container first https://quarkus.io/ Quarkus tailors your application for GraalVM and HotSpot. Amazingly fast boot time, incredibly low RSS memory (not just heap size!) offering near instant scale up and high density memory utilization in container orchestration platforms like Kubernetes.
  34. 34. 34Developer joy https://quarkus.io/ Combine both the familiar imperative code and the non-blocking reactive style when developing applications. A cohesive platform for optimized developer joy: ● Unified configuration; ● Zero config, live reload in the blink of an eye; ● Streamlined code for the 80% common usages, flexible for the 20%; ● No hassle native executable generation.
  35. 35. 35Best of breed libraries and standards https://quarkus.io/ Quarkus brings a cohesive, fun to use full-stack framework by leveraging best of breed libraries you love and use wired on a standard backbone.
  36. 36. 36Java & JVM 2019-Q3 graph http://infoq.link/java2019
  37. 37. 37Live demo WHAT COULD GO WRONG?
  38. 38. 38 Do zero a nuvem com Java e Kubernetes 02
  39. 39. 39Who we are 39 Sandro Giacomozzi Software Architect - fluig Alisson Medeiros Research & Developer Engeneering - fluig Eduardo Filipe Gomes Software Architect - TOTVS Roger Steuernagel Software Architect - TOTVS
  40. 40. 40Kubernetes for Java developers
  41. 41. 41 The ​​technology area is cyclical, from time to time the same technologies come back, with different names (Heidemann, Vanei) Series available at https://dev.to/sandrogiacom/kubernetes-for-java-developers-setup-41nk Kubernetes for Java developers
  42. 42. 42 Kubernetes is a portable, extensible open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available. https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/ What is Kubernetes
  43. 43. 43 • Docker • Minikube • Kubectl • VirtualBox • GNU make (recommended) https://github.com/sandrogiacom/k8s Setup
  44. 44. 44Before run Clone demo app https://github.com/sandrogiacom/java-kubernetes
  45. 45. 45Step one – Standalone App https://www.youtube.com/watch?v=X-h7Tbq5C4U
  46. 46. 46Step two – Docker App
  47. 47. 47Step two – Docker App https://www.youtube.com/watch?v=gPu1xJji6Hw
  48. 48. 48Step three – App on Kubernetes
  49. 49. 49Local running
  50. 50. 50Start Minikube minikube -p dev.to start --cpus 2 --memory=4098 minikube -p dev.to addons enable ingress minikube -p dev.to addons enable metrics-server kubectl create namespace dev-to https://www.youtube.com/watch?v=QUaAOBLy4y0
  51. 51. 51And K8s (K - ubernete - s) • Deployment • Pods • Replica Sets • Services • Ingress
  52. 52. 52Deploying database and application https://github.com/sandrogiacom/java-kubernetes/blob/master/kubernetes/mysql/mysql-deployment.yaml https://github.com/sandrogiacom/java-kubernetes/blob/master/kubernetes/app/app-deployment.yaml
  53. 53. 53Deploying database and application 1.https://www.youtube.com/watch?v=mp22hUMskZo 2.https://www.youtube.com/watch?v=8xARo8XhMa4 3.https://www.youtube.com/watch?v=bbUupigXKh4 4.https://www.youtube.com/watch?v=zvGhoV-tzwY
  54. 54. 54Scaling Application https://www.youtube.com/watch?v=xi2Ji1k3yOY
  55. 55. 55Deplying database kubectl apply -f kubernetes/mysql/
  56. 56. 56Build docker image local eval $(minikube -p dev.to docker-env) docker build --force-rm -t java-k8s .
  57. 57. 57Deploying app kubectl apply -f kubernetes/app/
  58. 58. 58Ingress – application with friendly access https://www.youtube.com/watch?v=-MVPY_mI-so
  59. 59. 59 Preparing docker and kubernetes to allow debugging Debug
  60. 60. 60Debug
  61. 61. 61Debug
  62. 62. https://www.youtube.com/watch?v=EYv_V73ZoZ8
  63. 63. 63 •Use JRE images instead of JDK •Automate everything possible •Use environment variables •Health check •Application info •Monitoring / Logs Good practices
  64. 64. 64Alinhamento e autonomia 🡪 juntos and shallow now
  65. 65. 65Ferramentas
  66. 66. 66Testes sempre, desde o unitário até o mais próximo de produção
  67. 67. 67Ferramentas
  68. 68. 68Todo mundo tem um plano até tomar o primeiro soco na cara - Mike Tyson
  69. 69. 69Monitoramento, rastreabilidade e alertas
  70. 70. 70Visão de arquitetura Processo de Desenvolvimento Processos, metodologias e padrões para o desenvolvimento. (Pipelines e documentações) 3 Plataforma Componentes de infraestrutura para suportar a operação (plataforma) e desenvolvimento (facilitadores para a abstração no framework). 2 Framework Java Framework Java seguindo a visão de arquitetura do TOTVS Platform com suporte a boas práticas de desenvolvimento de aplicações cloud nativas (DDD, TDD e BDD, Event Sourcing, CQRS). 1
  71. 71. 71Componentes de framework Repositório JSON Segurança (Oauth2 e JWT) API de Mensageria (Spring Cloud Stream e RabbitMQ) Domain Driven Design, Event Sourcing e CQRS Internacionalização e Localização Multi-Tenância (Database, Schema e Discriminator) Customização e Personalização Orquestração (BPMN, DMN, CMMN e Flowable) SPRING CLOUD FRAMEWORK Logging Coreografia
  72. 72. 72Componentes de plataforma Users System s Things Ingress (APIManager) KubernetesDNS (ServiceDiscovery) Identity (AuthenticationService) Kubernetes (Container Orquestration) Request #3 (Micro Service) Accountability #1 (Micro Service) Query #1 (Micro Service) Request #4 (Micro Service) Query #2 (Micro Service) Account #1 (Micro Service) RabbitMQAMQP (MessageBroker) Kubernetes Secrets&Config (ServiceConfig) TOTVSRAC (AuthorizationService) Istio,Prometheus& Grafana (Monitoring&Alert) ELK (Logging) TOTVS Environment Request #1 (Micro Service) Request #2 (Micro Service)
  73. 73. 73 • Criar uma arquitetura macro de referência, pensando em Processo (DevOps), Framework e Plataforma. • Entender que a fase de descoberta (Lean Inception, UX e Arquitetura) é essencial para a fase de desenvolvimento (#nogohorse). • Entender que o objetivo do Framework é facilitar e prover técnicas e que “nem todo problema é um prego e nem toda a solução é um martelo”. • Descobrir que a Plataforma é tão importante quanto o Framework a ser utilizado. **** • Descobrir que uma solução em nuvem é (muito) mais complexa por conta da necessidade de escalabilidade (custo). Esqueça o modelo on-premise tradicional. Good practices
  74. 74. ALLAN RODRIGO LEITE Obrigado! allanrodrigol@gmail.com EDUARDO FILIPE GOMES eduardo.filipe.gomes@gmail.com ALISSON MEDEIROS alisson.medeiros@gmail.com THIAGO ALMEIDA WEBER thiago_asw@hotmail.com JEFERSON FRANCISCO jeferson.gh@gmail.com SANDRO GIACOMOZZI sandrogiacom@gmail.com ROGER STEUERNAGEL roger@steuernagel.com.br WINSTON SONNESEN sonnesen@gmail.com

×