Best practices question

Hi guys,

Delphi Berlin, latest RO.

Some questions regarding best practices.

  1. Have one schema on the service controller (aka, the datamodule where the server, driver, etc components are) or one schema per Service. I’ll assume one on the service controller due to high chance of different services using the same schema. If thats the case, is it thread safe? we currently use one on the service controller. wrong?

  2. Have one dataStream per service. I’m doing so, but if it is something needed, why isnt built in on the DataAbstract form by default (property). If not, is it thread safe?

  3. Lets say we access two different databases from the same server. I keep the schemas separated, in order to have light weight schemas and keep things simple. Is it ok to have then two different schema components on the controller and as such two different connection Managers? or are we supposed to use some kind of TDAHetConnection thing and only one connection manager?. I’m doing it with two different connection managers but is it thread safe? I have both of them sharing the same driver manager component in order to avoid duplicates, the question, is this used only once? so thread safety is not an issue in the future?

Thank you in advance.

if you are using Schema in read-only mode, it doesn’t matter where it will be put: into server datamodule or into _Impl.
in this case, it can be considered at thread safe because Schema isn’t changed
in some scenarios, Schema can be loaded from .daSchema in run-time or can be changed dynamically for specific user after his login.

We support several data stream formats: Bin2 , JSON, Bin (legacy) and XML (legacy).
this component isn’t thread safe.

TDAConnectionManager is thread safe and is designed to work with different connections simultaneously. As a result, you can have only one TDAConnectionManager per server, but your solutions with several TDAConnectionManager instances also is possible.
TDAHetConnection is designed to have possibility to use tables from different DB in one schema. this component has several limitations so better to use usual connections.