database connection pool selection algorithm
By default, database connections can be configured automatically using the DataSource pool. Here is an algorithm for selecting a specific implementation: because of the performance and concurrency of the Tomcat data source connection pool, we always use it preferentially when Tomcat is available. If HIKARICP is available, we will use it. If Commons DBCP is available, we will use it, but it is not recommend
The Spring data for MongoDB is a sub-module of spring data. The goal is to provide a similar, consistent spring-based programming model for MongoDB.
The
widely used in domestic and foreign internet companies.The biggest feature of MongoDB is the support of the query language is very powerful, its syntax is somewhat similar to the object-oriented query language, almost can achieve similar relational database single-table query most of the functions, but also support the indexing of data. MongoDB's implementation of high-availability and read-write load bala
-availability and read-write load balancing is very concise and friendly, and MongoDB comes with the concept of a replica set that can be highly available, read-write, and load balanced by designing the right set of replicas and drivers.These features of MongoDB are very handy for high-performance querying of data, and MongoD
, adhere to the principle of diversification, choose a better and more economical way, rather than top-down unification. More commonly, we can directly use MongoDB to store key value pairs of data types, such as: Verification Code, session, etc. due to MongoDB's scale-out capability, it can also be used to store data that is very large in the future, such as: log
relevant POM on the Spring boot website.Create a new spring boot project, enter the Spring boot component auto-configuration URL, and click Next.Enter information about the purpose of the MAVEN entry and select the JDK version.Se
relational database single-table query most of the functions, but also support the indexing of data. MongoDB's implementation of high-availability and read-write load balancing is very concise and friendly, and MongoDB comes with the concept of a replica set that can be highly available, read-write, and load balanced by designing the right set of replicas and drivers.These features of
[Spring Data MongoDB] learning notes -- modify template insertion and modification operations, mongodb integrates spring
Insert operation:
Directly give an example
Import static org. springframework. data.
[Spring Data MongoDB] learning notes-awesome MongoTemplate and mongodb integration with spring
The operation template is an interface between the database and the Code. All operations on the database are in it.
Note: Producer template is thread-safe.
Using template implement
Recently, team started to try Spring Boot + Spring data JPA as a solution to the data tier, and after a few laps on the internet, it was found that everyone was not in the JPA, for (1) MyBatis simple and intuitive enough, (2) The spring
Recently work too busy, so delayed to everyone to share the actual combat springboot framework use.The following is the use of spring boot to integrate multiple frameworks.The first is to prepare for the job well.The first import framework requires packages that we use for MAVEN to manage the package.The above example is my h5ds real background management project, this project is in the hospitality financin
1.JPAJPA (Java Persistence API) is the Java Persistence specification proposed by Sun. It provides Java developers with an object/association mapping tool to manage relational data in Java applications. The main purpose of his presence is to simplify existing persistent development efforts and integrate ORM technology, and to end the current Hibernate,toplink,jdo and other ORM frameworks for each battalion. It is worth noting that JPA is developed on
MongoDB is used in the Spring boot project, and when MongoDB is not manipulated for a while, the next time you manipulate MongoDB there will be an exception. Exceptions are as follows:
org.springframework.data.mongodb.UncategorizedMongoDbException: Prematurely reached
In a few simple steps, you can configure your MongoDB connection and then manipulate the data using Mongotemplate:
1, the introduction of dependency:
2. Configure connection information in APPLICATION.YML:
Spring:
data:
MongoDB:
uri:mongodb://192.168.0.9:2
First, Spring Data JPA Introduction
The JPA (Java Persistence API) Java Persistence API is the standard specification for Java persistence, and Hibernate is a technical implementation of the persistence specification, and Spring Data JPA is a framework encapsulated on Hibernate.Development environment
Using the @repository interface provided by Springboot, you can accomplish the custom work that once required a lot of code writing and configuration files. These configurations, which previously gave novice programmers a headache and were proud of an experienced programmer, have become less important due to the continuous improvement of the framework and have also improved programmer productivity.This article describes how to manipulate MongoDB throu
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.