Choosing a database option

JHipster provides support for many kinds of database, ranging from SQL to NoSQL. The following are some considerations when choosing a database (DB):

  • For most cases, an SQL DB would be more than sufficient, so if you do not see any reason to go with other NoSQL solutions, stick to SQL and choose from MySQL, Postgres, Oracle, MariaDB, and MS SQL:
    • If you are working in an enterprise with Oracle or MS SQL subscriptions, then it would make sense to choose them as you would benefit from the support and enterprise features provided; otherwise, you should go with an open source solution.
    • If you need to store and query a lot of JSON data, then Postgres offers the best JSON support with full-text search capabilities.
    • For most simple use cases, MySQL or MariaDB will suffice.
    • Always choose a second-level Hibernate cache when working with a SQL DB.
    • When choosing a development database for SQL, you should do the following:
      • Choose an H2 file DB if you want a simple development setup with persistent data.
      • Choose the same DB as the production DB if you want faster restarts and your persistent data doesn't need to be wiped every now and then. If you are using the provided Docker images, then wiping data will not be an issue.
      • Choose an H2 in-memory DB if you do not want any persistent data during development and would like a clean state on each restart.
  • If your use case requires a lot of heavy data reads/writes, and if the data is not very relational, then Cassandra would be a perfect fit, as it is distributed and can work under extremely heavy loads.
  • For a normal, nonrelational data structure, MongoDB may be sufficient. You could also use Postgres as a NoSQL JSON store if needed.
  • If you need enterprise support for NoSQL, then CouchBase is a good option.
  • Use Elasticsearch along with the primary DB for full-text search. If you only need simple filtering, use the JPA filtering option provided. Refer to http://www.jhipster.tech/entities-filtering/ for more information.
  • Do not use Elasticsearch as a primary database if it is not built for that purpose.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.178.133