Coder Social home page Coder Social logo

springboot-tips's Introduction

SpringBoot Notes

Data access

  • h2
    • Query creation by method names and keywords
    • Query and native query
    • Auditing
  • mysql
    • paging & sorting
    • Customize hikari
  • Customize hikari connection (demo via mysql-jpa)
  • pagination and sorting (mysql-jpa)
  • transactional (mysql-jpa)
  • Multi jpa datasources
  • redis
  • mongodb
  • Neo4j (Graph db)
  • Hibernate related:
    • second-level cache
    • solve N+1 issue
  • JPA Stream

Spring Data’s stated mission is “to provide a familiar and consistent, Spring-based programming model for data access while still retaining the special traits of the underlying data store.”

Regardless of database or platform, Spring Data’s goal is to make the developer’s use of data as simple and as powerful as humanly possible.

Distributed Transaction

  • use Atomikos

Property Configuration

  • @Value
  • @ConfigurationProperties
  • Using Profiles to configure environment specific configuration
  • Check properties from actuator/env
  • Internationalization (i18n)

Dev tools

  • Live load

Reactive

Reactive should be end to end solution.

If interactions between the user’s browser and the backend application are nonblocking but the app has to wait for a blocking interaction with the database, the result is a blocking system.

  • WebFlux
  • Reactive Data Access (via r2dbc h2)
  • Reactive MongoDb
  • How to detect blocking calls

Testing

  • Unit testing (Controllers and Repository)
  • Integration test
  • Integration test with real db
  • Mocking

Security

A big topic

  • Form based authentication, authorization
  • OpenId connect authentication, Oauth2 authorization (Via 3rd party authorization server, eg: okta)
  • Resource server
  • Authorization server (Still an experiment project)

checkout: https://github.com/haodeng/spring-security-tips

Messaging

  • Amqp template with Rabbitmq

Deploy

  • Spring Boot Executable JAR
  • "Fully Executable" Spring Boot JAR
  • Build image (docker should be running)
  • publish image to docker hub
  • Build & publish image without docker (jib plugin)
  • Inspect an image

Logging

  • Customize console log
  • Inject logger via Lombok
  • Config logging for active profile
  • Logging to multiple log files

Caching

  • service layer cache (demo via spring default simple caching)
  • ehcache3 cache

Other

  • Spring retry
  • Scheduling
  • Dto and entity object conversion. Use mapstruct, checkout my "Techy notes" repository

springboot-tips's People

Contributors

haodeng avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.