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

Data Access with Sping Data

Data Access with Sping Data

This presentation outlines good practices for Data Access with Spring Data. In short, your data access should be boring so that exciting things can happen somewhere else so that you don't exhaust your complexity budget with unnecessarily complex arrangements just to access your persistent data.

Locality is a good guidance to keep things together that belong together.

Mark Paluch

August 27, 2024
Tweet

More Decks by Mark Paluch

Other Decks in Technology

Transcript

  1. Mark Paluch @mp911de mastodon.social/@mp911de Modern Data Access with Spring Data

    Copyright © 2005-2024 Broadcom, Inc. or its affiliates. Tweet by James Smith from NounProject.com Mastodon by Icon 54 from iconscout.com
  2. Mark Paluch @mp911de mastodon.social/@mp911de Modern Data Access with Spring Data

    Copyright © 2005-2024 Broadcom, Inc. or its affiliates. Tweet by James Smith from NounProject.com Mastodon by Icon 54 from iconscout.com Boring
  3. Fluent Interface • Guided through operations 🧑✈ • Reusable query

    stubs ♻ • Template and Repositories • Query by Example, Querydsl, JPA Specifications • JPA, MongoDB, Cassandra, Neo4j
  4. Scrolling • Abstraction to scroll 📜 large Chunks of data

    • Not a Page 📄 • Designed to cater various technologies • Offset-based scrolling 🔢 • Keyset scrolling 🗂 • Vendor-specific (e.g. Cassandra PagingState) 👩💻
  5. Scrolling • Window 🪟 • Abstraction over a window of

    data • Associated with a position (scroll pointer) • scroll 📜 • Method to scroll over windows of Data • WindowIterator 🧰 • Utility to iterate over windows
  6. Persistence Creators • Everything started with Constructors • @PersistenceConstructor ♻

    • Spring Data ❤ private Constructors • @PersistenceCreator can be • Constructors 👷 • Factory Methods 🏭
  7. Leveraging ConfigurationProperties • "…" - String Literal • #{…} -

    SpEL • Extension through EvaluationContextExtension • ${…} - Property Placeholder 🆕 • people_#{foo.bar()}_${myApp.tenant} • Value Expression (as in @Value)
  8. Questions Thank you github.com/mp911de/modern-spring-data @mp911de mastodon.social/@mp911de Copyright © 2005-2024 Broadcom,

    Inc. or its affiliates. Question by Mani Cheng from NounProject.com Tweet by James Smith from NounProject.com Mastodon by Icon 54 from iconscout.com