raketman/database-partition-processor
Composer 安装命令:
composer require raketman/database-partition-processor
包简介
This package provides a way to auto create|delete partition
关键字:
README 文档
README
This library provides a way to auto create|delete partition, which base of date field
!!!Work only for mysql partition!!!
/**
*
*
* @RaketmanDatePartition(
* table="analyzer_setting",
* type="month",
* id_field="id",
* date_field="created",
* safe_period="5",
* create_period="4",
* manual=true
* )
*/
if you use doctrine/annotation add @IgnoreAnnotation("RaketmanDatePartition")
RaketmanDatePartition options list:
table - table name
type - type of partition (day|month|year)
id_field - name of id field
date_field -name of date field, which use in partition definition
safe_period - count of past period, than could,t be delete | safe_period=null - partition not be deleted
create_period - count of future period, than be created
manual - (true|false), if true, to process this need to use --table options in script
To process partition you need to run command. This command add|delete partition based options in RaketmanDatePartition. Need to work periodically, for example in cron.
php vendor/raketman/database-partition-processor/bin/process.php --table=* --database-url=* --locate-dirs=* --env-database-url=*
--locate-dirs - dirs to scan RaketmanDatePartition (defaut src) (not required)
--database-url - url to connect, example mysql://db_user:db_password@127.0.0.1:3306/db_name (required one of url)
--env-database-url - env, who contain database-url (required one of url)
--table - table name to manual process (not required)
To create partition you need to run command. This command create partition definition based options in RaketmanDatePartition. Run only one time for each table, that you want partitionated.
create partition in manual mode, only one table for one run.
php vendor/raketman/database-partition-processor/bin/create.php --entity-path=/var/www/app/src/Entity/AnalyzerSetting.php --database-url=mysql://root:root@ngynx-analyzer-mariadb:3306/gosuslugi?cha
rset=utf8
--entity-path - file to scan RaketmanDatePartition
--database-url - url to connect, example mysql://db_user:db_password@127.0.0.1:3306/db_name (required one of url)
--env-database-url - env, who contain database-url (required one of url)
raketman/database-partition-processor 适用场景与选型建议
raketman/database-partition-processor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 07 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「Partition」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 raketman/database-partition-processor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 raketman/database-partition-processor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 raketman/database-partition-processor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Store your language lines in the database, yaml or other sources
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
A library to describe how to partition data from databases with yii2 framework
Partition problem for balanced arrays splitting made easy.
A PSR-7 compatible library for making CRUD API endpoints
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-31