定制 arthurtavaresdev/temaki 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

arthurtavaresdev/temaki

Composer 安装命令:

composer require arthurtavaresdev/temaki

包简介

README 文档

README

Temaki is a PHP library that combines the simplicity of Sushi with the flexibility of sqlite-s3, enabling Laravel applications to seamlessly and efficiently utilize SQLite databases stored on Amazon S3.

Motivation

When developing serverless applications with Laravel, especially using platforms like AWS Lambda and Laravel Vapor, we encounter significant challenges related to data storage and management due to the ephemeral nature of these environments. The volatility of the file system in Lambda instances prevents local data persistence, making traditional database solutions less effective. Moreover, the need for an SQLite driver that operates efficiently and persistently on Amazon S3 is evident to ensure data integrity and availability. Temaki was conceived to address this need by integrating the functionalities of Sushi and sqlite-s3, providing a robust and efficient solution for data storage in serverless environments.

How?

The SQLite database (a file) is stored on S3. The PHP class will transparently download the file locally on every request, and upload it back at the end.

Features

  • Integration with Laravel: Use Temaki as an Eloquent driver to access data stored in SQLite files on S3.
  • Transparent Synchronization: Temaki automatically manages the download and upload of the database between S3 and the local instance, ensuring data is always up-to-date.
  • Simplified Configuration: Simply add the Temaki trait to your Eloquent model and configure your S3 credentials to get started.

Requirements

  • PHP 8.3 or higher
  • Laravel 11.x or higher
  • PHP pdo_sqlite extension
  • Valid AWS credentials with access to S3 (Also works with minio)

Installation

You can install Temaki via Composer:

composer require arthurtavaresdev/temaki

Configuration

Set up S3 credentials: In your application's .env file, add the following variables:

AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
AWS_DEFAULT_REGION=your-region
AWS_BUCKET=your-bucket-name

Configure the Eloquent model:

Add the Temaki trait to your model and define the $sushiFilePath property with the path to the SQLite file on S3:

use Temaki\Temaki;

class YourModel extends Model
{
    use Temaki;

    public function getRows()
    {
        return [
            ['id' => 1, 'label' => 'admin'],
            ['id' => 2, 'label' => 'manager'],
            ['id' => 3, 'label' => 'user'],
        ];
    }
}

Usage

After configuration, you can use your Eloquent model as usual, and Temaki will handle the synchronization of data between S3 and the local instance.

Considerations

Temaki is ideal for development and testing environments in serverless architectures. For production environments, it's important to consider the implications of concurrency and latency associated with using databases stored on S3.

Contribution

Contributions are welcome! Feel free to open issues and pull requests in the GitHub repository.

License

This project is licensed under the MIT License.

arthurtavaresdev/temaki 适用场景与选型建议

arthurtavaresdev/temaki 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17.93k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 04 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「s3」 「sqlite」 「aws」 「serverless」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 arthurtavaresdev/temaki 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 arthurtavaresdev/temaki 我们能提供哪些服务?
定制开发 / 二次开发

基于 arthurtavaresdev/temaki 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 17.93k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-07