Select to view content in your preferred language

separating data into schemasin postgresql

208
4
10-04-2024 01:49 AM
yockee
by
Frequent Contributor

I want to separate data into schema based on their administrative location (city). For example: Schema 1 will hold data for City 1, Schema 2 will hold data for City 2.

I am using postgresql 13.

I am thinking of these options but can't decide the pros and cons: 

yockee_1-1728031704090.png

PS: i don't know if the second picture is possible

thanks 

Tags (3)
0 Kudos
4 Replies
George_Thompson
Esri Notable Contributor

I think that option 1 is possible and people do this already. You just have a different user (schema) & tablespace for the cities. This would cause you to have more overhead management with multiple data owners and some of the tasks that go along with that but may be easier in other areas.

Option 2 is not possible, that looks like the old multi-user schema GDB's that we deprecated in Oracle.

--- George T.
0 Kudos
MarceloMarques
Esri Regular Contributor

@yockee , please read the database connection best practices in the link below.

  • Database Connections Best Practices

    summary note:
  • never use the sde user to load the data
  • always create a data owner user to load the data
  • never edit the data using the data owner user, instead create editor and viewer users

Next, read the PostgreSQL database guidebook for Production Mapping to understand why you should use different data owner users to separate your data, and use different tablespaces to store the data to improve performance.

The database guidebook has lots of best practices, and if you want to go further, download the database template scripts. You can find the database guidebooks and database template scripts in my communiyty.esri.com blog below.

Mapping and Charting Solutions (MCS) Enterprise Databases Best Practices (esri.com)

In your scenario, I would create a separate geodatabase for each city data, to keep the data separate, to improve performance, and to enhance security.

| Marcelo Marques | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |
yockee
by
Frequent Contributor

"Never edit the data using the data owner user, instead create editor and viewer users"  --> whats the reason behind this ? 

 

Thanks

0 Kudos
MarceloMarques
Esri Regular Contributor

@yockee 

"Never edit the data using the data owner user, instead create editor and viewer users"

whats the reason behind this ? 

[Marcelo]: to prevent database deadlocks, for more detail read the database connection best practices in the link below.

| Marcelo Marques | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |
0 Kudos