This document discusses techniques for improving data persistence performance using JPA 2.1 and Hibernate. It covers analyzing performance issues, optimizing queries, caching, and entity fetching strategies. Specific techniques include using Hibernate statistics, native queries, fetch joins, named entity graphs, and the first- and second-level caches. The goal is to recognize and address performance problems early using Hibernate's features.
Connect 2016-Move Your XPages Applications to the Fast LaneHoward Greenberg
Are your XPages applications performing like a Florida senior citizen driving in the left lane at 55 mph? A key to speeding up your XPages applications is knowledge of the JSF lifecycle, partial refresh and partial execution. This session will cover these concepts and then apply them to optimizing an XPages application. Learn how to use tools to measure the performance of your XPages and determine where the bottlenecks are. Several sample applications will be analyzed along with alternative programming choices to improve their performance. Learn how to dramatically increase your XPages performance and make your users happy - you might even get a speeding ticket after this session!
Spring Data is a high level SpringSource project whose purpose is to unify and ease the access to different kinds of persistence stores, both relational database systems and NoSQL data stores.
Connect 2016-Move Your XPages Applications to the Fast LaneHoward Greenberg
Are your XPages applications performing like a Florida senior citizen driving in the left lane at 55 mph? A key to speeding up your XPages applications is knowledge of the JSF lifecycle, partial refresh and partial execution. This session will cover these concepts and then apply them to optimizing an XPages application. Learn how to use tools to measure the performance of your XPages and determine where the bottlenecks are. Several sample applications will be analyzed along with alternative programming choices to improve their performance. Learn how to dramatically increase your XPages performance and make your users happy - you might even get a speeding ticket after this session!
Spring Data is a high level SpringSource project whose purpose is to unify and ease the access to different kinds of persistence stores, both relational database systems and NoSQL data stores.
Slides for presentation on Cloudera Impala I gave at the DC/NOVA Java Users Group on 7/9/2013. It is a slightly updated set of slides from the ones I uploaded a few months ago on 4/19/2013. It covers version 1.0.1 and also includes some new slides on HortonWorks' Stinger Initiative.
A general- ‐purpose build automation tool. It can automate building, testing, deployment, publishing, generate documentation etc.
Designed to take advantage of convention over configuration.
Combines the power and flexibility of Ant with the dependency management and
conventions of Maven into a more effective way to build.
Cassandra Day Atlanta 2015: Building Your First Application with Apache Cassa...DataStax Academy
You’ve heard the talks, followed the tutorials, and done the research. You are a font of Cassandra knowledge. Now it’s time to change the world! (Or at least build something to make your boss happy). In this talk we’ll walk through the process of building KillrVideo, an open source video sharing website where users can upload and share videos, rate them, comment on them, and more. By looking at a real application, we’ll talk about architectural decisions, how the application drives the data model, some pro tips when using the DataStax drivers, and some lessons learned from mistakes made along the way. You’ll leave this session ready to start building your next application (world-changing or otherwise) with Cassandra.
OpenStack Horizon: Controlling the Cloud using DjangoDavid Lapsley
OpenStack is an open source cloud computing project that is implemented predominantly in Python. OpenStack’s goal is to provide the "ubiquitous open source cloud computing platform for public and private clouds”. The OpenStack project was launched by Rackspace and NASA in July 2010. Since then the project has gained considerable momentum with over 200 companies joining the project, and the launch of commercial services and products that use OpenStack.
The OpenStack Horizon project provides a web-based User Interface to OpenStack services. It is constructed in two parts: (1) a core set of libraries for implementing a Dashboard; (2) a reference dashboard implementation that uses the core set of libraries. Customization is a core part of the Horizon Framework. The framework enables developers to construct their own dashboards, panel groups and panels, and enables them to assemble them together via a common navigation/presentation framework.
In this presentation, we will provide a brief introduction to OpenStack and Horizon. Then we will dive into the details of Horizon. We will review Horizon’s overall architecture and how it integrates with other OpenStack services. We will look at some of Horizon’s interesting features and describe how to get started developing with Horizon. Finally, we will discuss some of the current challenges facing Horizon and some future directions.
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
What is different about this generation of web applications? A solid development approach must consider latency, throughput, and interactivity demanded by users users across mobile devices, web browsers, and IoT. These applications often use NoSQL to support a flexible data model and easy scalability required for modern development.
A full stack application (composed of Couchbase, WebAPI, Angular2, and ASP.NET/ASP.NET Core) will be demonstrated in this session. The individual parts of a stack may vary, but the overall design is the focus.
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Red Hat Developers
JBoss EAP7 brings support for the most recent industry standards and technologies, including Java EE7, the latest edition of the premier enterprise development standard. This session will provide an overview of the major additions to Java EE7, and how your team can use these capabilities on the advanced EAP7 runtime to produce better applications with less code.
Slides for presentation on Cloudera Impala I gave at the DC/NOVA Java Users Group on 7/9/2013. It is a slightly updated set of slides from the ones I uploaded a few months ago on 4/19/2013. It covers version 1.0.1 and also includes some new slides on HortonWorks' Stinger Initiative.
A general- ‐purpose build automation tool. It can automate building, testing, deployment, publishing, generate documentation etc.
Designed to take advantage of convention over configuration.
Combines the power and flexibility of Ant with the dependency management and
conventions of Maven into a more effective way to build.
Cassandra Day Atlanta 2015: Building Your First Application with Apache Cassa...DataStax Academy
You’ve heard the talks, followed the tutorials, and done the research. You are a font of Cassandra knowledge. Now it’s time to change the world! (Or at least build something to make your boss happy). In this talk we’ll walk through the process of building KillrVideo, an open source video sharing website where users can upload and share videos, rate them, comment on them, and more. By looking at a real application, we’ll talk about architectural decisions, how the application drives the data model, some pro tips when using the DataStax drivers, and some lessons learned from mistakes made along the way. You’ll leave this session ready to start building your next application (world-changing or otherwise) with Cassandra.
OpenStack Horizon: Controlling the Cloud using DjangoDavid Lapsley
OpenStack is an open source cloud computing project that is implemented predominantly in Python. OpenStack’s goal is to provide the "ubiquitous open source cloud computing platform for public and private clouds”. The OpenStack project was launched by Rackspace and NASA in July 2010. Since then the project has gained considerable momentum with over 200 companies joining the project, and the launch of commercial services and products that use OpenStack.
The OpenStack Horizon project provides a web-based User Interface to OpenStack services. It is constructed in two parts: (1) a core set of libraries for implementing a Dashboard; (2) a reference dashboard implementation that uses the core set of libraries. Customization is a core part of the Horizon Framework. The framework enables developers to construct their own dashboards, panel groups and panels, and enables them to assemble them together via a common navigation/presentation framework.
In this presentation, we will provide a brief introduction to OpenStack and Horizon. Then we will dive into the details of Horizon. We will review Horizon’s overall architecture and how it integrates with other OpenStack services. We will look at some of Horizon’s interesting features and describe how to get started developing with Horizon. Finally, we will discuss some of the current challenges facing Horizon and some future directions.
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
What is different about this generation of web applications? A solid development approach must consider latency, throughput, and interactivity demanded by users users across mobile devices, web browsers, and IoT. These applications often use NoSQL to support a flexible data model and easy scalability required for modern development.
A full stack application (composed of Couchbase, WebAPI, Angular2, and ASP.NET/ASP.NET Core) will be demonstrated in this session. The individual parts of a stack may vary, but the overall design is the focus.
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Red Hat Developers
JBoss EAP7 brings support for the most recent industry standards and technologies, including Java EE7, the latest edition of the premier enterprise development standard. This session will provide an overview of the major additions to Java EE7, and how your team can use these capabilities on the advanced EAP7 runtime to produce better applications with less code.
Spring Data Requery is alternatives of Spring Data JPA
Requery is lightweight ORM for DBMS (MySQL, PostgreSQL, H2, SQLite, Oracle, SQL Server)
Spring Data Requery provide Query By Native Query, Query By Example and Query By Property like Spring Data JPA
Spring Data Requery is better performance than JPA
Hibernate Tips ‘n’ Tricks - 15 Tips to solve common problemsThorben Janssen
Hibernate can do a lot more than just mapping a database table to an entity. It also provides a lot of features that make the implementation of your business logic quick and easy.
Video that accompanies these slides at: http://www.youtube.com/watch?v=v6cDIO7P5o8
Share v4.0 now gives developers, partners and implementors the ability to customize & extend the Share Document Library without having to either write or duplicate large amounts of code. This session will highlight the changes made to both the Repository and Web tier webscripts and show how new actions and custom metadata can be configured, often without touching a line of code! Some familiarity with the workings of the Document Library will be beneficial, as will general knowledge about configuring Share.
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesSanjeev Rampal
Talk presented at Kubernetes Community Day, New York, May 2024.
Technical summary of Multi-Cluster Kubernetes Networking architectures with focus on 4 key topics.
1) Key patterns for Multi-cluster architectures
2) Architectural comparison of several OSS/ CNCF projects to address these patterns
3) Evolution trends for the APIs of these projects
4) Some design recommendations & guidelines for adopting/ deploying these solutions.
# Internet Security: Safeguarding Your Digital World
In the contemporary digital age, the internet is a cornerstone of our daily lives. It connects us to vast amounts of information, provides platforms for communication, enables commerce, and offers endless entertainment. However, with these conveniences come significant security challenges. Internet security is essential to protect our digital identities, sensitive data, and overall online experience. This comprehensive guide explores the multifaceted world of internet security, providing insights into its importance, common threats, and effective strategies to safeguard your digital world.
## Understanding Internet Security
Internet security encompasses the measures and protocols used to protect information, devices, and networks from unauthorized access, attacks, and damage. It involves a wide range of practices designed to safeguard data confidentiality, integrity, and availability. Effective internet security is crucial for individuals, businesses, and governments alike, as cyber threats continue to evolve in complexity and scale.
### Key Components of Internet Security
1. **Confidentiality**: Ensuring that information is accessible only to those authorized to access it.
2. **Integrity**: Protecting information from being altered or tampered with by unauthorized parties.
3. **Availability**: Ensuring that authorized users have reliable access to information and resources when needed.
## Common Internet Security Threats
Cyber threats are numerous and constantly evolving. Understanding these threats is the first step in protecting against them. Some of the most common internet security threats include:
### Malware
Malware, or malicious software, is designed to harm, exploit, or otherwise compromise a device, network, or service. Common types of malware include:
- **Viruses**: Programs that attach themselves to legitimate software and replicate, spreading to other programs and files.
- **Worms**: Standalone malware that replicates itself to spread to other computers.
- **Trojan Horses**: Malicious software disguised as legitimate software.
- **Ransomware**: Malware that encrypts a user's files and demands a ransom for the decryption key.
- **Spyware**: Software that secretly monitors and collects user information.
### Phishing
Phishing is a social engineering attack that aims to steal sensitive information such as usernames, passwords, and credit card details. Attackers often masquerade as trusted entities in email or other communication channels, tricking victims into providing their information.
### Man-in-the-Middle (MitM) Attacks
MitM attacks occur when an attacker intercepts and potentially alters communication between two parties without their knowledge. This can lead to the unauthorized acquisition of sensitive information.
### Denial-of-Service (DoS) and Distributed Denial-of-Service (DDoS) Attacks
1.Wireless Communication System_Wireless communication is a broad term that i...JeyaPerumal1
Wireless communication involves the transmission of information over a distance without the help of wires, cables or any other forms of electrical conductors.
Wireless communication is a broad term that incorporates all procedures and forms of connecting and communicating between two or more devices using a wireless signal through wireless communication technologies and devices.
Features of Wireless Communication
The evolution of wireless technology has brought many advancements with its effective features.
The transmitted distance can be anywhere between a few meters (for example, a television's remote control) and thousands of kilometers (for example, radio communication).
Wireless communication can be used for cellular telephony, wireless access to the internet, wireless home networking, and so on.
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBrad Spiegel Macon GA
Brad Spiegel Macon GA’s journey exemplifies the profound impact that one individual can have on their community. Through his unwavering dedication to digital inclusion, he’s not only bridging the gap in Macon but also setting an example for others to follow.
This 7-second Brain Wave Ritual Attracts Money To You.!nirahealhty
Discover the power of a simple 7-second brain wave ritual that can attract wealth and abundance into your life. By tapping into specific brain frequencies, this technique helps you manifest financial success effortlessly. Ready to transform your financial future? Try this powerful ritual and start attracting money today!
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC
Ellisha Heppner, Grant Management Lead, presented an update on APNIC Foundation to the PNG DNS Forum held from 6 to 10 May, 2024 in Port Moresby, Papua New Guinea.
4. Performance
• Recognize performance problems as early as possible
• Typical causes for performance problems
• Solving performance problems
www.thoughts-on-java.org
12. SlowSELECTs • In general no „real“ JPA or Hibernate problem
• Check generated SQL
• Check execution plan of the statement
• Check indexes
• Optimize SELECT statement
• Consider to use a native query
www.thoughts-on-java.org
13. NativeQuery • Reasons to use native queries:
• JPQL supports only a subset of SQL
• Database specific features
• Native queries return an Object[] for each row
• Needs to be mapped programmatically or declaratively
www.thoughts-on-java.org
19. FetchType
• Defines when the relationship will be fetched
• Static definition in entity mapping
www.thoughts-on-java.org
@ManyToMany(mappedBy="authors", fetch = FetchType.EAGER)
private Set<Book> books;
20. FetchType • Lazy
• Relationship gets loaded at first access
• Default for to-many relationships
• Eager
• Loads relationships immediately
• Default for to-one relationships
www.thoughts-on-java.org
21. Recommendations • To-many relationships
• Stick to the default mapping (FetchType.LAZY)
• Use eager fetching for specific queries, if required
• To-one relationships
• Check individually
• Default is fine in most of the cases
www.thoughts-on-java.org
23. N+1Select? • Most common cause for performance problems
• Lazy fetching of related entities creates too many queries
www.thoughts-on-java.org
List<Author> authors = this.em.createQuery("SELECT a FROM Author a",
Author.class).getResultList();
for (Author a : authors) {
System.out.println("Author " + a.getFirstName() + " " + a.getLastName()
+ " wrote " + a.getBooks().size() + “ Books.”));
}
24. Queryspecificfetching
• Fetch all required entities with one query
• Fetch Joins
• @NamedEntityGraph
• EntityGraph
www.thoughts-on-java.org
26. FetchJoin
• Use JOIN FETCH instead of JOIN in JPQL query
www.thoughts-on-java.org
List<Author> authors = this.em.createQuery(
"SELECT DISTINCT a FROM Author a JOIN FETCH a.books b",
Author.class).getResultList();
27. FetchJoin • Advantages
• Relationships gets loaded in same query
• Disadvantages
• Requires a special query for each use case
• Creates cartesian product
www.thoughts-on-java.org
29. NamedEntityGraph • Introduced in JPA 2.1
• Declaratively defines a graph of entities which will be loaded
• Graph is query independent
www.thoughts-on-java.org
31. NamedEntityGraph • Provide entity graph es hint
www.thoughts-on-java.org
EntityGraph graph = this.em.getEntityGraph("graph.AuthorBooks");
this.em.createQuery("SELECT DISTINCT a FROM Author a")
.setHint("javax.persistence.loadgraph", graph);
32. NamedEntityGraph • Fetch graph
• Eager loading for all elements of the graph
• Lazy loading for all other attributes
• Load graph
• Eager loading for all elements of the graph
• Loads all other attributes with their defined FetchType
• Hibernate always uses a load graph
• HHH-8776
www.thoughts-on-java.org
33. NamedEntityGraph • Advantages
• Query specific EAGER loading
• Definition of the graph is independent of the query
• Disadvantages
• Creates cartesian product
www.thoughts-on-java.org
35. EntityGraph • Introduced in JPA 2.1
• Dynamic version of @NamedEntityGraph
• Definition via Java API
• Graph is query independent
www.thoughts-on-java.org
36. EntityGraph • Define and use EntityGraph
www.thoughts-on-java.org
EntityGraph graph = this.em.createEntityGraph(Author.class);
Subgraph<Book> bookSubGraph = graph.addSubgraph(Author_.books);
bookSubGraph.addSubgraph(Book_.reviews);
this.em.createQuery("SELECT DISTINCT a FROM Author a")
.setHint("javax.persistence.loadgraph", graph);
37. EntityGraph • Advantages
• Query specific EAGER loading
• Definition of the graph is independent of the query
• Dynamic creation at runtime
• Disadvantages
• Creates cartesian product
www.thoughts-on-java.org
41. 1stLevelCache
• Activated by default
• Linked to the Hibernate session
• Stores all entities that were used within a session
• Transparent usage
www.thoughts-on-java.org
43. 2ndLevelCache • Session independent entity store
• Needs to be activated
• persistence.xml or EntityManagerFactory
• Transparent usage
• PersistenceProvider doesn‘t need to provide it
• Not always portable
www.thoughts-on-java.org
44. 2ndLevelCache • Shared Cache Mode
• ALL cache all entities
• NONE cache no entities
• ENABLE_SELECTIVE cache needs to be activated for
specific entities
• DISABLE_SELECTIVE cache can be deactivated for specific
entities
• UNSPECIFIED use default settings of the
PersistenceProvider
www.thoughts-on-java.org
45. 2ndLevelCache • Cache configuration
• Cache Retrieve Mode
• How to read entities from the cache
• Cache Store Mode
• How to write entities to the cache
• Concurrency Strategy
• How to handle concurrent access
www.thoughts-on-java.org
47. QueryCache • Hibernate specific
• Stores query result session independent
• Needs to be activated (persistence.xml)
• hibernate.cache.use_query_cache = true
• Activate caching for a specific query
• org.hibernate.Query.setCacheable(true)
• @NamedQuery(… hints =
@QueryHint(name="org.hibernate.cacheable", value="true"))
www.thoughts-on-java.org
48. QueryCache • Stores query results for a query and its parameters
• [„FROM Author WHERE id=?“, 1] [1]
• Stores only entity references or scalars
• Always use together with 2nd Level Cache
www.thoughts-on-java.org
49. Recommendations • Only cache data that is seldom updated
• Always benchmark the application when adding or changing
caching
• Use Query Cache together with 2nd Level Cache
• Configuration has to fit to each other
www.thoughts-on-java.org
51. Get this presentation and a handy cheat sheet:
http://www.thoughts-on-java.org/javaland2016/
Follow me on twitter:
@thjanssen123
www.thoughts-on-java.org
54. Resources • Java Persistence with Hibernate Second Edition by Christian
Bauer, Gaving King, Gary Gregory
• Java Platform, Enterprise Edition: The Java EE Tutorial
https://docs.oracle.com/javaee/7/tutorial/index.html
• Hibernate: Truly Understanding the Second-Level and
Query Caches
http://www.javalobby.org/java/forums/t48846.html
www.thoughts-on-java.org