Work project

CRM Snapshots

Zoho CRM modules in PostgreSQL, ready to analyze

A service that bulk-copies Zoho CRM modules into PostgreSQL so they can be analyzed with SQL outside the CRM, and logs every run.

Recreation of a SQL client on the snapshot database, with one table per CRM module, a query on the run log and another of deals by stage, with the latest snapshot of each module completed. (open the full-size image)
Recreated with fictional data; the real system is private.

What it is about

To analyze the CRM with SQL, the service exports each module with Zoho's Bulk Read API and loads it into PostgreSQL. Each run empties the module's table and fills it again, so the database always holds the latest copy.

It started in 2025 as one script per module and in 2026 became a FastAPI service with authentication and metrics.

What it does

  • Uses Zoho's Bulk Read API to request each module's export, wait for the ZIP file, unpack it and load the CSV into PostgreSQL.
  • Covers the modules an institution's analysis needs, among them leads, deals, contacts, campaigns, notes and users.
  • Every run lands in a log table with the module, the date, the client and its status.
  • The current version is a FastAPI API with key authentication and Prometheus metrics, deployed in Docker.

How it works

From the CRM to PostgreSQL

Data flows from Zoho to the service and from the service to PostgreSQL.

  1. Zoho CRM

    • Bulk Read API per module
    • ZIP exports with CSV
  2. Service

    • FastAPI API
    • Key authentication
    • Prometheus metrics
  3. PostgreSQL

    • One table per module
    • A record of every run
    • Queries and dashboards

Decisions and their costs

  1. Bulk exports instead of queries

    The regular API makes you page through a module record by record.

  2. One record per run

    Without a record, knowing how fresh each copy is means reading the logs.

Stack

Pick a technology to see the projects that use it.