Postgres DB
Overview
MOSIP uses Postgres DB for all relational data storage. The DB creation SQL scripts are located under /db_scripts the folder of the module repository. In sandbox deployment, Postgres is installed as a docker inside the cluster. However, in production deployment, typically, Postgres will be installed external to the cluster.
ER diagrams
Entity relationships diagrams for all databases used in MOSIP are given below.
Configuration parameters
Connection details
{module_name}_database_url{module_name}_database_username{module_name}_database_password
Hibernate configurations
javax.persistence.jdbc.driverhibernate.dialecthibernate.jdbc.lob.non_contextual_creationhibernate.hbm2ddl.autohibernate.show_sqlhibernate.format_sqlhibernate.connection.charSethibernate.cache.use_second_level_cachehibernate.cache.use_query_cachehibernate.cache.use_structured_entrieshibernate.generate_statisticslogging.level.org.hibernate.SQLlogging.level.org.hibernate.type
Production DB configuration
These are some of the reference settings of a production database. It is expected that these are reviewed and finalized for a given deployment.
resources:
limits: {}
# cpu: 250m
# memory: 1Gi
requests:
cpu: 8000m
memory: 32000Mi
postgresqlExtendedConf:
wal_level: logical
max_wal_senders: 20
max_replication_slots: 10
shared_buffers: 16GB
max_prepared_transactions: 1000
huge_pages: try
work_mem: 16MB # min 64kB
maintenance_work_mem: 3GB # min 1MB
effective_cache_size: 32GB
log_min_duration_statement: 1000Last updated
Was this helpful?