[GIS] geoserver problem to join sql-server table to a layer

geoserverpostgissql server

i have a layer published on geoserver based on a connection to a postgres/postgis Table and i need to add another table existing on sql server to do a data jointure table to table in order to add external data to my layer..

is there any way to do it?

tnks in advance to your Help.

Best Answer

Not a scalable solution. WMS is light weight, geojson at some point will become too heavy for web application (try making a geojson of say 100,000 point and load it on web using openlayer now do the same with WMS, you will see the difference).

Better solution is to foreign data wrappers postgres have extension that can add the tables directly from other databases. Then you can easily make view in postgres using foreign tables + native tables. this you don't even need to use 2 separate stores in geoserver.

So this is basically connect one database to another.

https://wiki.postgresql.org/wiki/Foreign_data_wrappers

https://www.mssqltips.com/sqlservertip/3663/sql-server-and-postgresql-foreign-data-wrapper-configuration--part-3/