Shut down the app
Use this guide to take the RAI Native App offline when you no longer need it running. It explains when to stop the app and how to choose the right shutdown depth in SQL or through a Python client.
When to shut down the app
Section titled “When to shut down the app”Shut down the app when:
- You are done using the app.
- You want to reduce ongoing costs while the app is idle.
What happens when you stop the app
Section titled “What happens when you stop the app”There are three shutdown modes that achieve different levels of cost reduction by dropping different sets of resources. All modes suspend the app’s CDC service, delete all reasoners, and cancel in-progress jobs. The difference is whether the app service, app warehouse, and compute pools are only suspended or are dropped and recreated the next time you start the app.
Use the following table to choose a shutdown depth before you stop the app:
| What to use | When to use it |
|---|---|
| Stop and suspend managed resources |
|
| Stop, suspend, and remove SPCS service |
|
| Stop and remove all managed resources |
|
Stop the app and suspend resources
Section titled “Stop the app and suspend resources”Choose this option when you want to stop the app but leave the app service, app warehouse, and compute pools in place as suspended resources. This is the lightest shutdown and the quickest option to reverse.
Call the relationalai.app.deactivate() procedure with no arguments:
CALL relationalai.app.deactivate();+------------------------------------------------+| RelationalAI service deactivated successfully. |+------------------------------------------------+Create a Snowpark session from your default PyRel connection with create_config(), then call the relationalai.app.deactivate() SQL procedure with no arguments:
from relationalai.config import create_config
session = create_config().get_session()
session.sql("CALL relationalai.app.deactivate()").collect()Stop the app and remove the SPCS service
Section titled “Stop the app and remove the SPCS service”Choose this option when you want a deeper shutdown that removes the app service but preserves the app warehouse and compute pools as suspended resources. Use it when you want more teardown than the default mode without fully removing the app’s managed infrastructure.
Call the relationalai.app.deactivate() procedure with 'service' as the argument:
CALL relationalai.app.deactivate('service');+------------------------------------------------+| RelationalAI service deactivated successfully. |+------------------------------------------------+Create a Snowpark session from your default PyRel connection with create_config(), then call the relationalai.app.deactivate() SQL procedure with 'service' as the argument:
from relationalai.config import create_config
session = create_config().get_session()
session.sql("CALL relationalai.app.deactivate('service')").collect()Stop the app and drop all managed resources
Section titled “Stop the app and drop all managed resources”Choose this option when you want the deepest shutdown and do not need to keep the app warehouse or compute pools available for the next start. Use it when cost reduction matters more than restart speed.
Call the relationalai.app.deactivate() procedure with 'all' as the argument:
CALL relationalai.app.deactivate('all');+------------------------------------------------+| RelationalAI service deactivated successfully. |+------------------------------------------------+Create a Snowpark session from your default PyRel connection with create_config(), then call the relationalai.app.deactivate() SQL procedure with 'all' as the argument:
from relationalai.config import create_config
session = create_config().get_session()
session.sql("CALL relationalai.app.deactivate('all')").collect()