# Databases

Databases are a crucial component of WalliD CertiShop, serving as the **source of truth** for all certificate data and ensuring robust verification capabilities. Whenever someone verifies a certificate—whether through a QR code, the embedded PDF, or a link—the system checks the original data stored in the database. This enables retrieval of the **certificate's current state** (e.g., valid, revoked, or expired) or verification of the cryptographic proof through the chosen protocol.

#### Key Features of the Database:

1. **Certificate Data Storage**
   * All certificate data is securely stored in the database.
   * Provides easy access for verification queries.
2. **Verification Backbone**
   * Real-time verification connects to the database to ensure accuracy.
   * Cross-checks the current state of the certificate (valid, revoked, or expired).

### Database options

{% hint style="info" %}
**Check how you can use your own databases** [**here!**](/certishop-on-prem/intro.md)
{% endhint %}

WalliD CertiShop provides flexible storage options for certificate data with a cloud based solution managed by WalliD and an On Prem solution for issuers with high levels of privacy needs.

### **1. Cloud-Based Storage**

Managed by WalliD, ensuring high availability and security. Used by default.

### **2. On-Premises Storage**

Clients can host and manage their own databases for greater control.

<figure><img src="/files/iKBwvHfOfRRQ8OpizcUZ" alt=""><figcaption></figcaption></figure>

The On Prem architecture consists of the following components:

1. **CertiShop SDK:** Integrated into the client's website, it interacts with the Gateway or Webhooks.
2. **CertiShop API:** Centralized service that manages authentication and monitors all operations.
3. **Client-Gateway:** A pre-built service deployed in the client’s infrastructure to handle credential operations.
4. **Client's Data Layer:** The client's custom implementation for storing and managing credential data.

#### Communication Flow

1. CertiShop makes an initial call to the API to retrieve the On Prem configuration.
2. Based on the configuration:
   * The SDK calls the **webhooks** provided by the client.
   * OR interacts with the **Client-Gateway**, which handles operations locally.
3. Once an operation is complete, the Gateway or Webhooks notify the API for logging purposes.

#### Diagrams

* **Solution Overview:** Show SDK → API → Gateway → Client DB.
* **Communication Sequence:** Include an interaction diagram for both Webhook and Gateway flows.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wallid.io/architecture/databases.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
