You can use the .onSelChange callback to change section states in response to a section change.
Outfile test.exe
!include Sections.nsh
!include LogicLib.nsh
Page Components
Page InstFiles
Section "Client"
SectionIn RO
SectionEnd
Section /o "Database" SEC_DB
SectionEnd
Section /o "Server" SEC_SRV
SectionEnd
Section /o "Interface"
SectionEnd
Function .onSelChange
${If} ${SectionIsSelected} ${SEC_SRV}
!insertmacro SetSectionFlag ${SEC_DB} ${SF_RO}
!insertmacro SelectSection ${SEC_DB}
${Else}
!insertmacro ClearSectionFlag ${SEC_DB} ${SF_RO}
${EndIf}
FunctionEnd
Or without read-only DB section:
Function .onSelChange
var /Global HadSecSrv
${IfNot} ${SectionIsSelected} ${SEC_DB}
${If} $HadSecSrv <> 0
!insertmacro UnselectSection ${SEC_SRV}
${EndIf}
${EndIf}
StrCpy $HadSecSrv 0
${If} ${SectionIsSelected} ${SEC_SRV}
StrCpy $HadSecSrv 1
!insertmacro SelectSection ${SEC_DB}
${EndIf}
FunctionEnd