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

NoSQL design pitfalls with Java Montreal JUG

NoSQL design pitfalls with Java Montreal JUG

Non-relational databases have come with the promise of assisting software in the Big Data age, handling the challenges of variety, velocity, and volume that come with it.
However, several points plague even the most experienced software architects: How do I migrate my data to NoSQL and which one? Where are the relationships? Should I use some ORM? The purpose of this talk is to answer all of these questions and provide some essential tips so that your NoSQL experience is not a disaster.

Otávio Santana est un ingénieur logiciel avec une vaste expérience dans le développement open source, avec plusieurs contributions à JBoss Weld, Hibernate, Apache Commons et à d'autres projets. Axé sur le développement multilingue et les applications haute performance, Otávio a travaillé sur de grands projets dans les domaines de la finance, du gouvernement, des médias sociaux et du commerce électronique. Membre du comité exécutif du JCP et de plusieurs groupes d'experts JSR, il est également un champion Java et a reçu le JCP Outstanding Award et le Duke's Choice Award.

C8709f1d7ae6cc5f057e37e01d6e28db?s=128

Otavio Santana

March 16, 2021
Tweet

Transcript

  1. Otavio Santana @otaviojava NoSQL design pitfalls with Java member of

    KI group
  2. Otavio Santana @otaviojava Staff Engineer • Java Champion • JCP-EC-EG-EGL

    • Apache Committer • Eclipse Committer • Eclipse Project Leader • Book and blog writer Speaker
  3. What it is not!

  4. • “New research shows 75% of ‘open’ Redis servers infected”

    • The Twelve Factor App NoSecurity
  5. • Schemaless • Validation No Data integrity

  6. • Complexity • Maintain No Responsibility

  7. • The right questions • Horizontal vs Vertical • Write

    vs Read Scalability??
  8. • Benchmark • CAP theorem No-mistake

  9. • CAP theorem • Backup No-Trade-off

  10. • SQL • NewSQL • NoSQL No-single-solution

  11. Model

  12. • Key • Biggest mistakes • View Modeling

  13. None
  14. What Apache Cassandra is not

  15. • Big Data • Rich Query • Relational Cassandra

  16. • Key ◦ Partition Key ◦ Clustering Key • Secondary

    Key • Allow Filtering Queries
  17. • List • Map • Tuple • UDT Cassandra Powers

  18. • Load Balancer • Consistency Level ALL • Backup Troy

  19. Sample @Entity public class Contact { @Id private String name;

    @Column private LocalDate birthday; @Column private Map<String, String> details; } • Map • UDT
  20. Sample @Entity class Car { @Id private String plate; @Column

    private String city; @Column private String color; @UDT("owner") @Column private Owner owner; } • UDT
  21. Sample @Entity public class Recipe { @Id private String name;

    @Column private String city; @Column @UDT("ingredient") private Set<Ingredient> ingredients; } • Set • UDT
  22. MongoDB

  23. • Transaction • ACID What MongoDB is not

  24. “In a relational database, we usually model the schema at

    the very beginning of the project. Why is this so bad? Because the beginning of the project is exactly the moment that we know least about it” Oren Eini - Modeling in a Non Relational World
  25. • Coherence • Independence • Isolation DDD - Elemar Jr

  26. • Self Sufficient • Business Coherence

  27. • Exist • It does not need anyone Independence La

    liberté guidant le people (1830)
  28. • Cannot impact another entity Isolation

  29. • Entity • Aggregate • Value Object Sample @Entity public

    class Order { @Id private ObjectId id; @Column private LocalDateTime orderedAt; @Column private List<Product> items; @Column private Address shipTo; }
  30. Cloud

  31. • Containers • Mutable • Kubernetes • Services Cloud

  32. • Bean Validation • ORM • Reactive programming • Impedance

    Java Frameworks
  33. © xgeeks | 02/12/2020 33 Demo Time

  34. xgeeks is changing the game in making things happen –

    giving on-demand capacity and bringing expertise filling skill gaps
  35. What makes us strong We are bringing passion and eXpertise

    into the team. High Coding standards Reliable and proven processes and quality testing Continuous Innovation Senior/Junior split 1:2 enables room for innovation Integration in KI group Strong backing and steady exchange with experts Flexible work style Individual and flexible, fully acustomed to our clients
  36. Thank you Otávio Santana Staff Engineer, Xgeeks Join us!! http://xgeeks.io/

    @xgeeksio