You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PostgreSQL offers a feature called "hot standby". This mode is read-only and has a few other limitations. I'm not yet 100% sure when a server would be in that mode, but in either case: tobira serve should likely support that as well as it can.
Obviously, GraphQL mutations won't work. In that case, returning 500 is fine, though "503 Service Unavailable" would be better.
Read-only GraphQL queries should just work. I think they currently do not work as all of our queries are using a serializable transaction. Hot standby mode does NOT support serializable transactions (see docs above). For read-only queries, we likely can get the same data consistency guarantees with a lower transaction mode, especially considering that the hot standby is read-only anyway so... we could not use a transaction at all I guess? We can either detect whether the DB is in hot standby mode and switch to a lower isolation level OR we could inspect the GraphQL query and, for read-only ones, switch to a lower isolation level. Or both.
Further, starting Tobira will try to apply DB migrations, also happening in a serializable transaction. We have to find a solution to that as wlel.
By the way, tobira worker likely can't work at all in this mode as all of its functions need to write to the DB.
The text was updated successfully, but these errors were encountered:
PostgreSQL offers a feature called "hot standby". This mode is read-only and has a few other limitations. I'm not yet 100% sure when a server would be in that mode, but in either case:
tobira serve
should likely support that as well as it can.Obviously, GraphQL mutations won't work. In that case, returning 500 is fine, though "503 Service Unavailable" would be better.
Read-only GraphQL queries should just work. I think they currently do not work as all of our queries are using a serializable transaction. Hot standby mode does NOT support serializable transactions (see docs above). For read-only queries, we likely can get the same data consistency guarantees with a lower transaction mode, especially considering that the hot standby is read-only anyway so... we could not use a transaction at all I guess? We can either detect whether the DB is in hot standby mode and switch to a lower isolation level OR we could inspect the GraphQL query and, for read-only ones, switch to a lower isolation level. Or both.
Further, starting Tobira will try to apply DB migrations, also happening in a serializable transaction. We have to find a solution to that as wlel.
By the way,
tobira worker
likely can't work at all in this mode as all of its functions need to write to the DB.The text was updated successfully, but these errors were encountered: