If we want to use the data, can you tell us where the data is stored , and the how to connect to database
The data is stored in multiple places. The core data is stored in Postgres and the event data is stored in Clickhouse.
You can see a more detailed diagram here: https://develop.sentry.dev/architecture/
Can the sentry (company) team also have access to these data? Do you have some services implemented in on-premise sentry codebase, so that sentry (company) can have access to someone else hosted data?
Certainly not. The only communication from self-hosted instances to sentry.io is our regular beacons that report aggregate event volume in the past 24 hours and the number of users, projects, teams, and organizations along with Sentry version and whether it uses Docker. You can see the code for the beacon here: https://github.com/getsentry/sentry/blob/330ed7234eddee86b23f8c814ae0471217843eaa/src/sentry/tasks/beacon.py
You can chose to anonymize the data, which means your admin email won’t be sent in the payload or you can turn off the beacon completely by setting
SENTRY_BEACON=False in your config.
Thanks, buddy. You save my day.