Database
A database is a collection of data gathered by users. Utilizing a storage-computing separation architecture, a database can be linked to a specific Nodegroup, similar to traditional Postgres databases, allowing users to add, delete, modify, and query data. A database can also function independently from a computing unit (Nodegroup).
Primary methods for connecting a Database to a Nodegroup:
- Creating a Database in the Nodegroup using SQL commands (e.g., CREATE DATABASE xxx), which will display the new database information on the "Database" page of Data Cloud.
- Detaching the Database from the Nodegroup results in a database that is independent of any Nodegroup; it can later be reattached to the original or a different Nodegroup.
- Backing up (Backup) and restoring (Restore) to a specific Nodegroup.
Methods to detach a Database from a Nodegroup:
- Deleting the Database in the Nodegroup using SQL (e.g., DROP DATABASE xxx).
- Using the Detach operation to remove the Database from the Nodegroup.
Note: Changes in the relationships between Database and Nodegroup and updates to storage size may take several minutes to reflect.
Database Search
On the database page, the status of all databases in the current Data Cloud is displayed by default. Key information includes the database handle (Handle), the database name (DatabaseName) after appending the database and Nodegroup, the binding status (Attached/Detached), and the storage size, among other current database operations. Additionally, the page shows the total storage size of the databases, the storage size for each state, and the storage size of databases bound to each Nodegroup, as illustrated in the figure below:
The search box offers robust search functions, including:
- Fuzzy search: Enter a keyword (like "post") into the search box to display database entries that include the keyword in fields such as the database handle (Handle), Nodegroup name (NodegroupName), database name (DatabaseName), and more.
- Exact match: The search box allows precise matching using "field name: field value". For instance:
- handle: Matches the handle field exactly, e.g., handle:postgres-9c1475d0
- DatabaseName: Matches the databaseName field exactly, e.g., DatabaseName:postgres
- NodegroupId: Matches the NodegroupId field exactly, e.g., NodegroupId:wb3vlgqzev
- NodegroupName: Matches the NodegroupName field exactly, e.g., NodegroupName:v_nodegroup
- state: This field matches the state field, currently accepting values like attached and detached (other invalid values), e.g., state: attached.
Notes:
- Fuzzy searches and exact matches can be combined and separated by spaces.
- Multiple exact matches can also be combined and separated by spaces.
- When using multiple fuzzy search keywords, only results for the last keyword will be shown, and only the previous key's results will be displayed for multiple matches of the same key.
- All keys are case-insensitive, while all values (including fuzzy searches) are case-sensitive.
Database Management
We offer various database operations, including renaming the database handle (Handle), unbinding the Database and Nodegroup (Detach), binding the Database and Nodegroup (Attach), backing up the database (Backup), restoring the database (Restore), and deleting the Database (Drop).
- Rename: When creating a new database, the system generates a database handle, typically using the name as a prefix. Users can rename this handle to suit their preferences, but it must remain unique within the same Data Cloud. This renaming can be done for a single database or in batches for multiple databases.
- Detached: A connected Database can be detached from its Nodegroup/database name as long as the Nodegroup is in the "Running" state.
- Backup: If the Nodegroup is in the "Running" state, refer to the "Backup and Restore" page for more information.
- Restore: For more details, refer to the "Backup and Restore" page, as long as the restore target's Nodegroup is in the "Running" state.
- Attached: You can attach a Database to a specific Nodegroup, provided the Nodegroup is in the "Running" state.
- Delete: Deleting a Database is the same as executing DROP DATABASE xxx, provided the Nodegroup is in the "Running" state.
Access the Database details page to view comprehensive information and set the PITR time window, illustrated below:
Users can customize the time range on the storage page and observe the changes in the database storage size represented in a curve.