Informational: Understanding Spotfire Library Request/Response Flow with S3 External Storage.

Informational: Understanding Spotfire Library Request/Response Flow with S3 External Storage.

book

Article ID: KB0138431

calendar_today

Updated On:

Products Versions
Spotfire All

Description

  • Customers often need to understand the business logic and request/response flow for library operations (search, load, save) when Spotfire Server uses S3 as external library storage.
  • This understanding is crucial for troubleshooting performance issues or failures. Specifically,
    • The order of requests and responses between Spotfire Analyst, Spotfire Server, Spotfire Server Database (PostgreSQL/Other Database), and External library storage (S3) during library search, content loading, and saving.
    • Whether a failure in the Spotfire Server Database can impact requests for search, load content, and save methods to external library storage, especially when timeout errors occur in the server logs.
  • When S3 is configured for external library storage, the Spotfire Server acts as the mandatory orchestrator. The Database stores metadata for library files, permissions, system configuration, and licenses, essentially holding the library structure (folders, names, permissions, and GUIDs). S3 stores the actual binary file data (blobs).
  • The content stored in external storage never changes for each key (DATA_ID, which is distinct from ITEM_ID) during normal operations. The check-external-library command can identify inconsistencies [check-external-library].

Resolution

The following outlines the request/response flow for library operations and the impact of database failures:

  • Library Search Method Flow:

    • Spotfire Analyst -> Spotfire Server: User sends a search query or opens a folder.
    • Spotfire Server -> Spotfire Server Database: The server queries the LIB_ITEMS and LIB_DATA tables.
    • Spotfire Server Database -> Spotfire Server: Returns metadata (item names, types, created dates).
    • Spotfire Server -> Spotfire Analyst: Displays the search results.
  • LoadContent (Open) Method Flow:

    • Spotfire Analyst -> Spotfire Server: Request to open a specific Library ID.
    • Spotfire Server -> Spotfire Server Database: Verifies permissions and retrieves the S3 object key associated with that ID.
    • Spotfire Server -> S3: The server fetches the actual binary data (DXP file) from the S3 bucket.
    • S3 -> Spotfire Server: Data stream is sent to the server.
    • Spotfire Server -> Spotfire Analyst: The server passes the data stream to the Analyst client.
  • Save Method Flow:

    • Spotfire Analyst -> Spotfire Server: Uploads the new or updated DXP file.
    • Spotfire Server -> S3: The server streams the binary data to S3 and receives a "Success" response.
    • Spotfire Server -> Spotfire Server Database: The server updates or inserts the metadata record in the database, committing the transaction.
    • Spotfire Server -> Spotfire Analyst: Confirms the save was successful.
  • Troubleshooting of Spotfire Server Database/S3 Failure:

    • S3 is not contacted during a library search; this operation is purely a Spotfire Server and Database interaction.If the library search is not working, the Spotfire Server Database is the culprit
    • If the Spotfire Database experiences high CPU or disk I/O, the "Search" method will fail first because it is 100% database-dependent. The "Save" and "Load" methods will subsequently fail as they cannot complete their metadata handshake with the database.
    • If S3 were the sole problem, the Search function would operate normally, but Load and Save operations would fail during the data streaming phase (ensure no network bottlenecks or permission changes are affecting the data streaming phase between the Spotfire Server and the S3 bucket). For more, check for "Access Denied" errors or service outages in the S3.

    • Also, the DBA team can identify long-running locks on the LIB_ITEMS table during reported timeout periods.
      Example
      : If using PostgresSQL as your Spotfire database, the DBA team can investigate PostgreSQL pg_stat_activity to identify long-running locks on the LIB_ITEMS table during reported timeout periods. Note that PostgreSQL is an MVCC database, so SQL Server-style locks are not directly applicable, but other locking mechanisms exist.

Issue/Introduction

This article explains the request/response flow for library search, load, and save operations when Spotfire Server is configured with S3 as external library storage. It also clarifies how Spotfire Server Database issues can affect these operations.

Additional Information

Doc: Library content storage outside of the Spotfire database

Doc: Monitoring external library storage and fixing inconsistencies

Doc: The command check-external-library