In this blog, we are going to talk about caching in Hibernate.
Hibernate is an ORM Framework for Java. It is a framework for mapping Object-Oriented Model to Relational Model. Hibernate is concerned with data persistence as it applies to relational databases (via JDBC). It performs powerful object-relational mapping and query databases using HQL and SQL. It can cut down a lot of complexity and thus defects as well from your application, which may otherwise find a way to exist. We can also say it is a boon for developers with limited knowledge of SQL.
Why String is Immutable?
This is one of the most popular interview questions. In this blog, we are going to talk about it and find the answer. String is one of the most used Class in any Application. For storing the username, password, address, IP address etc, we need to create String objects. So it is necessary to understand why our most famous and used Class is Immutable.
In our last two blogs, we talked about the HDFS Cluster & Zookeeper Cluster. Which is needed for deploying OpenTSDB in clustered mode. Continuing to the series, In this blog, we are going to talk about HBase which will be used by OpenTSDB in the cluster to store data.
HBase is a column-oriented NoSQL database management system that runs on top of Hadoop Distributed File System (HDFS).
Redis stands for Remote Dictionary Server. It is opensource, in-memory key value data strucure store, which is extremely fast. In other words, it can also called as caching no sql database.
So, Redis is no sql database which can be used as a cache or message broker. The data structure supported by it are lists, hashes, strings, sets, sorted sorts with range queries, bitmaps, hyperloglogs and geo spatial indexes with radius queries. It has built in replication, Lua scripting, LRU eviction, transcations and different levels of one-disk persistence. It also provides high availiblity via Redis Sentinel and automatic partitioning with Redis cluster.
Sometimes we have to run a long-running task in a separate thread and return the result once execution is complete. Using Java Runnable interface we can run a task, but the disadvantage is it does not return result once execution is complete.
Then how can we achieve this?
There are two interfaces available in java.util.concurrent package using them we can solve this problem.
The acquisition of Sun Microsystems by Oracle Corporation was completed on January 27, 2010, and became the owners of Java.
In September 2017, Oracle gave up on Java Enterprise Edition (JEE), aka J2EE, to The Eclipse Foundation. On February 2018, The open source version of Java Enterprise Edition (Java EE) has been renamed Jakarta EE to satisfy Oracle’s desire to control the “Java” brand.
Many times we have to write some set of task which can be executed after a certain interval of time. These types of task are called timer task.
So we can achieve it by using threads which will sleep for a certain amount of time and execute again. But wait, Can Java do this for me So that I can focus on logic instead of worrying about how to schedule tasks for me?
Yes, Java can do the scheduling thing for you. So you write your logic and let Java handle the scheduling work.