Skip to main content

Architecture

Overview

Tarobase combines traditional backend services with web3 technology to provide a hybrid solution for modern web and mobile applications. This architecture allows developers to leverage the benefits of both centralized and decentralized systems.

Key Components

  1. Tarobase SDK: The client-side library that applications use to interact with Tarobase services.
  2. API Layer: Handles requests from the SDK and routes them to the appropriate services.
  3. Authentication Service: Manages user authentication and session handling.
  4. Data Storage:
    • Off-chain storage that aggregates blockchain-based data and traditional data into a single data store
    • On-chain storage for blockchain-based data
  5. Smart Contract Layer: Manages on-chain data and executes blockchain transactions.
  6. Policy Engine: Enforces access rules and data validation based on defined policies regardless if data is being set on-chain or off-chain.

Data Flow

  1. Client application makes a request through the Tarobase SDK.
  2. The SDK formats the request and sends it to the API Layer.
  3. The API Layer authenticates the request and applies any necessary transformations.
  4. The Policy Engine checks the request against the defined policies.
  5. For off-chain data, the request is routed to the appropriate data storage service.
  6. For on-chain data, the request is sent to the Smart Contract Layer for on-chain policy engine verification and processing.
  7. The response is sent back through the API Layer to the SDK.
  8. The SDK returns the data to the client application.

On-Chain vs. Off-Chain Storage

Tarobase allows developers to choose between on-chain and off-chain storage for different types of data:

  • On-Chain Storage:

    • Used for data that requires high transparency and immutability
    • Stored directly on the blockchain (all data is public)
    • Slower and more expensive for frequent updates
    • Ideal for critical application state, ownership records, etc.
  • Off-Chain Storage:

    • Used for data that doesn't require blockchain features
    • Stored in traditional databases
    • Faster and more cost-effective for frequent updates
    • Ideal for user profiles, application metadata, etc.
    • Private data can be stored privately

Smart Contract Integration

Tarobase's Smart Contract Layer manages the interaction with blockchain networks:

  1. Deploys and manages application-specific smart contracts
  2. Handles transaction signing and submission
  3. Manages gas fees and transaction optimization
  4. Provides abstraction for complex blockchain operations

Security Considerations

  1. Authentication: Uses secure, blockchain-based authentication methods
  2. Data Encryption: Applies encryption to sensitive off-chain data
  3. Access Control: Enforces granular access control through the Policy Engine
  4. Smart Contract Auditing: Regularly audits and updates smart contracts for security
  5. Rate Limiting: Implements rate limiting to prevent abuse of the API and blockchain resources

Scalability

Tarobase's architecture is designed for scalability:

  1. Horizontal Scaling: API and off-chain storage layers can be scaled horizontally
  2. Caching: Implements caching strategies to reduce blockchain queries
  3. Optimistic Updates: Uses optimistic updates for improved user experience
  4. Batch Processing: Aggregates multiple on-chain transactions when possible

For more detailed information on Tarobase's architecture and best practices for building scalable applications, refer to our Advanced Topics section.