dnocode/yii2-awsddb
Composer 安装命令:
composer require dnocode/yii2-awsddb
包简介
Amazon dynamo db ActiveRecord for the Yii framework
README 文档
README
This extension provides activeRecord support for amazon dynamo db
return [ //.... 'components' => [ ddb' => [ "class"=>'dnocode\awsddb\ar\Connection', 'base_url'=>"http://localhost:8000 [OPTIONAL ONLY FOR DYNAMO LOCAL]", 'key' => 'AMAZONKEY', 'secret' => 'AMAZONSECRET', 'region' => 'eu-west-1' ], ] ];
Installation
Add to composer dependencies
"dnocode/yii2-awsddb": "*"
USING
How to define a model
class Element {
public $name;
public $surname;
public $sex;
public $uid;
/**hash and range**/
public static function primaryKey(){ return ["uid"];}
public function rules(){ return [[['uid'], 'required']];}
}
#put
$e=new Element();
$e->name
$e->name="nerd";
$e->surname="iam";
$e->sex="no_nerd_i_said";
$e->uid="ciao";
$e->save();
#find and update
$element=Element::find()->where(["uid"=>"ciao"]) ->one();
$element->surname="update";
$consumer->save();
#delete and update
$element=Element::find()->where(["uid"=>"ciao"]) ->one();
$element->delete();
Element::deleteAll(["uid"=>"ciao"]);
find with where
$element=Element::find()->
where(["surname"=>"iam"])
->one();
Find object with the hash key
the active record will use
get operation 4 performance*/
```
$element=Element::find()->
andWhere("uid")
->eq("ciao")
->all();*/
```
Execute find on attribute that isn`t primary key
will be execute a scan operation with filter on that attribute
```
$element=Element::find()->
andwhere("surname")->eq("prova")
->all();
```
Compare attribute with more than one value
```
$element=Element::orWhere("name")->in(["name1","name2"])
->all();
```
#TODO
- batch operations with transaction
- support for relation
- iterator for query with more than 1MB
dnocode/yii2-awsddb 适用场景与选型建议
dnocode/yii2-awsddb 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 110 次下载、GitHub Stars 达 3, 最近一次更新时间为 2014 年 12 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「amazon」 「activerecord」 「yii2」 「dynamo db」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dnocode/yii2-awsddb 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dnocode/yii2-awsddb 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dnocode/yii2-awsddb 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
ActiveRecord for API
CalendarView widget for Yii 2 Framework.
A custom URL rule class for Yii 2 which allows to create translated URL rules
This package includes a script and fail2ban configuration that allows you to use fail2ban when utilizing AWS elastic load balancer (ELB) and an apache webserver.
Relational attributes support for YII2 ActiveRecord
Fast ActiveRecord
统计信息
- 总下载量: 110
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-12-30