The SessionFactory interface is heavyweight, and every application typically has a single instance per application. However, sometimes, an application uses more than one database, which leads to one instance per database. SessionFactory is used to obtain the instance of Session. It is very important, as it caches the generated SQL statements and the data generated, which Hibernate uses at runtime in one unit of work as a first-level cache.