Hey @toxic quest ,
First of all many thanks for the reply, its kind and we appreciate 🙏
- I ran the query for the tenant we see using most in our multitenant in the POC
EXPLAIN ANALYZE
SELECT id, snapshot FROM transactions
WHERE tenant_id = 'c58f2d3a-9122-437b-9f9b-09c06f23c039'
ORDER BY id DESC LIMIT 1;
result:
"Limit (cost=0.41..1.89 rows=1 width=29) (actual time=0.057..0.057 rows=1 loops=1)"
" -> Index Scan Backward using pk_transaction on transactions (cost=0.41..19490.37 rows=13157 width=29) (actual time=0.056..0.056 rows=1 loops=1)"
" Filter: ((tenant_id)::text = 'c58f2d3a-9122-437b-9f9b-09c06f23c039'::text)"
"Planning Time: 0.085 ms"
"Execution Time: 0.074 ms"
-
No, we send always the latest value from the latest data write.
-
On data datadog the API cuncurrent numbers are ~2 RPS, but when i cross reference to what i see on the postgres server logs side the database is authenticating an average of ~23.5 new connections per second (~1,400/min), with peaks hitting ~42 connections per second (~2,500/min).
For reference the DB we are using is Azure Burstable, B2ms, 2 vCores, 8 GiB RAM, 32 GiB storage.
Thanks!!