
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@icekuma/bktdb
Advanced tools
- bucket: 数据桶, 逻辑上代表一类数据的集合, 粒度由业务层定义, 可能随业务发展变化, 业务和运维最小操作单元 - vtable: 虚拟表, 一类bucket 的集合, 数据量过大一般会根据Hash分成多个bucket
接口所有操作, 基于bucket, 不管数据是否分片, 接口使用方式统一
业务接口
add(item)
: 新增一条数据list(filter, limit, offset, sort)
: 枚举数据, 非幂等的操作, 同样的条件, 多次枚举可能返回结果不同(受数据量动态变化以及大数据搜索算法的影响)remove(filter)
: 删除数据update(filter, item)
: 更新数据search()
: 搜索, 基于ES, 需要提前使用vTableToEsFull, vTableToEsChange
同步数据到ES中运维接口 针对kv/用户数据量暴增场景(分库分表)
bucketReMap()
: bucket -> collection 重新映射, 解决数据量大问题, Hash, Range, Single, date, 监听oplog数据变更, 接近平滑升级(迁移索引)(单库)bucketMigrate
: bucket迁移, 比如热数据迁移到高性能SSDbucketReMeta()
: 重建meta信息, 一般在remap,migrate后执行bucketSwitch()
: 迁移后切换bucket, bucket滚动升级, 升级过程中锁定bucket只读, 验证数据完整性, 切换配置(需要重命名临时表)
bucketVerify()
: 数据校验, 验证新老bucket 数据是否一致, 对比每个Doc 字段是否一致针对数据升级?
bucketUpgrade()
: bucket 字段升级, mgo用的少, 一般都是兼容老Doc, 新Doc字段上区分, 不像mysql 表结构强一致针对运维统计场景
bucketScan(callback)
: 扫描bucket, 用于统计等常见使用业务应该避免以下操作(低频除外)
3个场景:
特性:
扩展:
demo: 网盘场景
bid = <num/value>
item -> bucket
bucket -> collection (collection 限制小于等于128)
bucket_topo 信息 | name | type | key | num | map | ctime | mtime | ver |
bucket_meta 信息 | vtable | name | db | coll | alias_coll | type | key | status | rcnt | wcnt | ctime | mtime | ver |
bucket_tag 信息 | vtable | name | tags |
bucket 数据量 count(user)xNxM + hash_128 10w用户x5个维度x100个item + 128 = 5000w条数据 日活2k(缓存)
运维场景
问题?
难点?
2021-04-14: DONE
TODO
问题?
2021-04-21
TODO:
单机: 2G
*0 *0 *0 *0 0 1|0 0.2% 10.0% 0 2.21G 339M 0|0 1|0 535b 43.6k 20 rs01 PRI Apr 23 09:10:17.166
66 98 64 *0 82 126|0 0.7% 10.0% 0 2.20G 339M 0|1 2|1 214k 279k 31 rs01 PRI Apr 23 09:10:18.182
259 298 257 *0 350 354|0 0.8% 10.0% 0 2.20G 339M 0|0 1|0 756k 897k 31 rs01 PRI Apr 23 09:10:19.174
insert query update delete getmore command dirty used flushes vsize res qrw arw net_in net_out conn set repl time
316 298 319 *0 409 483|0 0.9% 10.1% 0 2.20G 339M 0|1 2|1 947k 1.07m 31 rs01 PRI Apr 23 09:10:20.166
329 290 327 *0 374 434|0 0.9% 10.2% 0 2.20G 339M 0|1 1|1 893k 1.04m 31 rs01 PRI Apr 23 09:10:21.183
342 393 342 *0 384 455|0 1.0% 10.2% 0 2.20G 339M 0|0 1|0 960k 1.11m 31 rs01 PRI Apr 23 09:10:22.175
353 307 353 *0 403 439|0 1.2% 9.9% 0 2.20G 338M 0|0 2|1 932k 1.10m 31 rs01 PRI Apr 23 09:10:23.185
341 386 342 *0 405 500|0 1.2% 10.0% 0 2.20G 337M 0|0 1|4 1.01m 1.14m 31 rs01 PRI Apr 23 09:10:24.169
352 337 352 *0 460 501|0 1.3% 10.1% 0 2.20G 337M 0|0 4|3 1.02m 1.17m 31 rs01 PRI Apr 23 09:10:25.193
363 356 361 *0 421 522|0 1.4% 10.2% 0 2.20G 337M 0|0 1|2 1.04m 1.18m 31 rs01 PRI Apr 23 09:10:26.171
341 372 341 *0 444 452|0 1.4% 10.2% 0 2.20G 337M 0|0 1|6 972k 1.14m 31 rs01 PRI Apr 23 09:10:27.168
276 240 278 *0 307 391|0 1.5% 10.3% 0 2.20G 337M 0|3 2|1 772k 881k 31 rs01 PRI Apr 23 09:10:28.182
359 363 359 *0 428 506|0 1.5% 10.3% 0 2.20G 337M 0|1 1|1 1.03m 1.18m 32 rs01 PRI Apr 23 09:10:29.180
insert query update delete getmore command dirty used flushes vsize res qrw arw net_in net_out conn set repl time
347 374 347 *0 391 489|0 1.5% 10.3% 0 2.20G 337M 0|1 1|0 992k 1.13m 32 rs01 PRI Apr 23 09:10:30.178
367 330 366 *0 353 463|0 0.4% 10.0% 0 2.20G 341M 0|0 2|0 954k 1.10m 32 rs01 PRI Apr 23 09:10:31.172
351 375 350 *0 440 477|0 0.5% 10.1% 0 2.20G 340M 0|0 1|3 1.00m 1.16m 32 rs01 PRI Apr 23 09:10:32.174
349 333 351 *0 423 481|0 0.5% 10.2% 0 2.20G 340M 0|3 1|1 986k 1.13m 32 rs01 PRI Apr 23 09:10:33.183
372 362 371 *0 408 462|0 0.6% 10.2% 0 2.20G 340M 0|0 2|1 987k 1.16m 32 rs01 PRI Apr 23 09:10:34.174
346 371 346 *0 438 484|0 0.7% 9.9% 0 2.20G 338M 0|0 1|1 1.00m 1.16m 32 rs01 PRI Apr 23 09:10:35.172
342 318 342 *0 384 416|0 0.8% 10.0% 0 2.21G 338M 0|0 2|0 899k 1.07m 32 rs01 PRI Apr 23 09:10:36.176
359 377 360 *0 463 527|0 0.9% 10.1% 0 2.21G 338M 0|0 1|0 1.07m 1.21m 32 rs01 PRI Apr 23 09:10:37.169
355 360 354 *0 387 468|0 0.9% 10.2% 0 2.21G 338M 0|2 1|1 972k 1.12m 32 rs01 PRI Apr 23 09:10:38.172
319 311 319 *0 437 430|0 1.0% 10.2% 0 2.21G 338M 0|0 1|3 912k 1.07m 32 rs01 PRI Apr 23 09:10:39.180
insert query update delete getmore command dirty used flushes vsize res qrw arw net_in net_out conn set repl time
234 222 234 *0 271 316|0 1.0% 10.3% 0 2.21G 339M 0|1 1|0 648k 765k 32 rs01 PRI Apr 23 09:10:40.187
350 367 351 *0 393 459|0 1.1% 10.3% 0 2.21G 338M 0|0 2|0 964k 1.12m 32 rs01 PRI Apr 23 09:10:41.181
341 329 340 *0 417 477|0 1.2% 10.4% 0 2.21G 338M 0|0 1|2 973k 1.11m 32 rs01 PRI Apr 23 09:10:42.180
325 350 326 *0 408 464|0 1.2% 10.5% 0 2.21G 338M 0|1 1|0 951k 1.09m 32 rs01 PRI Apr 23 09:10:43.168
364 331 363 *0 450 472|0 1.3% 10.5% 0 2.21G 338M 0|0 1|0 997k 1.17m 32 rs01 PRI Apr 23 09:10:44.168
358 372 358 *0 443 506|0 1.4% 10.6% 0 2.21G 338M 0|0 1|0 1.03m 1.19m 32 rs01 PRI Apr 23 09:10:45.178
347 356 347 *0 418 482|0 1.5% 10.7% 0 2.21G 338M 0|0 1|3 990k 1.14m 32 rs01 PRI Apr 23 09:10:46.166
374 357 375 *0 454 508|0 1.5% 10.3% 1 2.21G 338M 0|1 1|0 1.05m 1.21m 32 rs01 PRI Apr 23 09:10:47.179
95 55 94 *0 110 138|0 1.5% 10.3% 0 2.21G 337M 0|0 1|0 261k 327k 32 rs01 PRI Apr 23 09:10:48.164
*0 *0 *0 *0 0 5|0 1.5% 10.3% 0 2.21G 337M 0|0 1|0 1.13k 46.0k 32 rs01 PRI Apr 23 09:10:49.163
2021-04-27
2021-05-08
FAQs
- bucket: 数据桶, 逻辑上代表一类数据的集合, 粒度由业务层定义, 可能随业务发展变化, 业务和运维最小操作单元 - vtable: 虚拟表, 一类bucket 的集合, 数据量过大一般会根据Hash分成多个bucket
We found that @icekuma/bktdb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.