1.非规范化Vs规范化
规范化的方法是,你关注的人的feed列表中是每条动态的ID,非规范的存储是动态的所有信息。
仅存储ID可以大幅度减少内存消耗,然而这意味着每次加载feed都要重新访问数据库。如何选择取决于你在进行非规范化存储时,复制数据的频率。比如构建一个消息通知系统和一个feed系统有很大的区别:通知系统中每个动作的发生只需要被发送给几个用户,而feed系统中每个动态的数据可能要被复制给成千上万的粉丝。
另外,如何选择取决于你的存储架构,使用Redis时,内存是需要特别注意的问题;而使用Cassandra要占用大量的存储空间,但是对于规范化数据来说使用并不简单。
对于feed通知和基于Cassandra构建的feed,笔者建议将你的数据非规范化。而基于Redis的feed你需要最小化内存消耗,并保持数据规范化。采用Feedly可以轻松实现两种方案。flavors.me/221048
flavors.me/andsy144
flavors.me/cqyyp234
flavors.me/hccsg986
flavors.me/qmjxg492
flavors.me/shflq482
flavors.me/cqzmo495
flavors.me/zccgf136
flavors.me/xjtbk841
flavors.me/yknca855
flavors.me/aojqs044
flavors.me/xtpxd883
flavors.me/vgvfo509
flavors.me/smjny347
flavors.me/uhfbq537
flavors.me/mxoon264
flavors.me/nskce544
flavors.me/xbedu567
flavors.me/ktgks743
flavors.me/ucali747
flavors.me/lsrye773
flavors.me/nnnmw773
flavors.me/isnfz151
flavors.me/oeraq602
flavors.me/ddhvv618
flavors.me/bqnvf456
flavors.me/cmjjx446
flavors.me/epfxh624
flavors.me/cajry195
flavors.me/hunlp837
flavors.me/vlwsm113
flavors.me/mbggj040
flavors.me/kgunt868
flavors.me/hlavm506
flavors.me/jpwjw574
flavors.me/kksxo874
flavors.me/yjuel259
flavors.me/vpimw067
flavors.me/xswag067
flavors.me/rhubs424
flavors.me/aroci457
flavors.me/ksicg450
flavors.me/qhgyd840
flavors.me/agjsl696
flavors.me/nflzi951
flavors.me/xgfay974
flavors.me/gqqaw977
flavors.me/qrkbm991
flavors.me/vlovd642
flavors.me/tqcdo360
flavors.me/rvily109
flavors.me/ojwtj825
flavors.me/ykqth840
flavors.me/vxwts566
flavors.me/tdcbd305
flavors.me/qqqio023
flavors.me/slmwg013
flavors.me/jbwkc049
flavors.me/tcqks072
flavors.me/rhesl791
flavors.me/ovkaw439
flavors.me/mgoun970
flavors.me/njkix270
flavors.me/jhjca458
flavors.me/oavwr900
flavors.me/ychxh913
flavors.me/vpvea641
flavors.me/tubml460
flavors.me/kktzh326
flavors.me/mfpnr496
flavors.me/prmua609
flavors.me/diobx884
flavors.me/bvcii622
flavors.me/ybiqt349
flavors.me/wooye187
flavors.me/rslen300
flavors.me/bbfxd303
flavors.me/cwblv393
flavors.me/eaxzf593
flavors.me/nbrzd596
flavors.me/lgxho234
flavors.me/iulpz051
flavors.me/yboon451
flavors.me/vhuwy287
flavors.me/xcqki267
flavors.me/tipdl477
flavors.me/crjeb470
flavors.me/sqzzo483
flavors.me/pvghz122
flavors.me/rzcvj391
flavors.me/suyjb481
flavors.me/ibgeg394
flavors.me/jxcsx694
flavors.me/piomo146
flavors.me/rrzne169
flavors.me/oxovp887
flavors.me/qakjh077
flavors.me/zcvbx070
flavors.me/fvhwo522
flavors.me/owbwm555
flavors.me/mkhex263
flavors.me/fzffj558
flavors.me/lsjaa209
flavors.me/fihbe466
flavors.me/cnwjp284
flavors.me/aacri921
flavors.me/flolz472
flavors.me/hpczi662
flavors.me/euqht480
flavors.me/oejhr403
flavors.me/ljppc122
flavors.me/neldm322
flavors.me/xofek325
flavors.me/odprg171
flavors.me/uoblx623
flavors.me/neznj089
flavors.me/phvbt189
flavors.me/qcrhl379
flavors.me/amdhb372
flavors.me/bnwiz385
flavors.me/runde298
flavors.me/kkleq555
flavors.me/iprmb293
flavors.me/gcful010
flavors.me/dilcw758
flavors.me/flhqo948
flavors.me/ombqe951
flavors.me/ksbkh151
flavors.me/hgbwu462
flavors.me/flhdf101
flavors.me/ombed104
flavors.me/qqxsn104
flavors.me/rltgf494
flavors.me/xexaw945
flavors.me/uklih662
flavors.me/sxrqs300
flavors.me/gotxp875
flavors.me/difrg326
flavors.me/bhnek331
flavors.me/ymbmv059
flavors.me/awirv566
flavors.me/hyndd031
flavors.me/dvmxg321
flavors.me/ybuqk539
flavors.me/wuylt070
flavors.me/tzetm799
flavors.me/rfsaw537
flavors.me/aolbm540
flavors.me/ytsjx278
flavors.me/pjjwb215
flavors.me/zkvxr218
flavors.me/wyjec956
flavors.me/oftsy682
flavors.me/ypmsx686
flavors.me/xccsz447
flavors.me/qgkks932
flavors.me/atpyw831
flavors.me/xiflk753
flavors.me/vvlsu571
flavors.me/wqhgm779
flavors.me/acenw782
flavors.me/ntgtl267
flavors.me/pxcad257
flavors.me/wwnzr757
flavors.me/cqlxk792
flavors.me/zdsfv410
flavors.me/xjynf258
flavors.me/gkrnd152
flavors.me/wsumk650
flavors.me/fboni673
flavors.me/lnahz124
flavors.me/eqovj314
flavors.me/oriwh327
flavors.me/lfiit451
flavors.me/bezdg344
flavors.me/ucxek621
flavors.me/edrfi624
flavors.me/kwvzz375
flavors.me/fuutu583
flavors.me/hxqhm553
flavors.me/ejpff810
flavors.me/kctaw361
flavors.me/bkkna098
flavors.me/pjmup573
flavors.me/uvqog024
flavors.me/mkhck053
flavors.me/ngdqu042
flavors.me/xpxqs046
flavors.me/abuxt269
flavors.me/uqsyf424
flavors.me/drezv457
flavors.me/fbyrt450
flavors.me/saayi937
flavors.me/cbtzg930
flavors.me/hnxtx401
flavors.me/ngjoo153
flavors.me/widoe156
flavors.me/khfvb431
flavors.me/uiqwr434
flavors.me/tegwu196
flavors.me/pkfpx386
flavors.me/azyvk156
flavors.me/ynedv874
flavors.me/hoydt897
flavors.me/fbele513
flavors.me/cpnxz847
flavors.me/uxwkv573
flavors.me/zqaem225
flavors.me/xvomx043
flavors.me/uavui781
flavors.me/igunl079
flavors.me/rhoob092
flavors.me/lfmqn259
flavors.me/qqyke701
flavors.me/eparb285
flavors.me/flwfl475
flavors.me/puhfj478
flavors.me/rqdmt678
flavors.me/azxmr671
flavors.me/pzalx970
flavors.me/dyksu456
flavors.me/ftygm446
flavors.me/kthnb921
flavors.me/uutoz824
flavors.me/denpp847
flavors.me/jprjg399
flavors.me/sylke302
flavors.me/caeku325
flavors.me/pzgrr882
flavors.me/vlkmi524
flavors.me/wogas521
flavors.me/utuhl360
flavors.me/jhvty573
flavors.me/lcrhq761
flavors.me/jmucy611
flavors.me/objjr051
flavors.me/moprc779
flavors.me/ratlt211
flavors.me/bjmmj244
flavors.me/klgnh247
flavors.me/qekhy998
flavors.me/rzgni988
flavors.me/xtkhz630
flavors.me/gueix653
flavors.me/ajcjb920
flavors.me/xxqru666
flavors.me/vcwzf374
flavors.me/nromb113
flavors.me/wtinr136
flavors.me/ywwbj306
flavors.me/zrspt504
flavors.me/nxriw804
flavors.me/iuqcz092
flavors.me/gifkk810
flavors.me/bfedn020
flavors.me/hziye562
flavors.me/iuemo761
flavors.me/onigf213
flavors.me/pjeux501
flavors.me/hyvht239
flavors.me/jurvd439
flavors.me/kdyad927
flavors.me/lhuov115
flavors.me/ncqcf205
flavors.me/tnuww957
flavors.me/urqco957
flavors.me/myhqk985
flavors.me/vibqi888
flavors.me/tnhyt625
flavors.me/qavge343
flavors.me/achhu366
flavors.me/jlbhs379
flavors.me/lgxvc369
flavors.me/iuddm187
flavors.me/mxajw391
flavors.me/nbwxg391
flavors.me/pwsly588
flavors.me/rfmmo504
flavors.me/olsuz220
flavors.me/kqrnc510
flavors.me/lmnbu700
flavors.me/nhjpe700
flavors.me/mczpg569
flavors.me/gsxrs726
flavors.me/hvtfk926
flavors.me/bkrgn281
flavors.me/gevae932
flavors.me/qfptc955
flavors.me/silhm935
flavors.me/porpx663
flavors.me/nbfwq482
flavors.me/kgleb120
flavors.me/mchsl328
flavors.me/rvlmc869
flavors.me/ntkgf359
flavors.me/owgup349
flavors.me/mbvci068
flavors.me/kobjt804
flavors.me/lqukj817
flavors.me/vzolh830
flavors.me/ebalx735
flavors.me/kumgo587
flavors.me/tvyge400
flavors.me/xhvnn523
flavors.me/oomaj250
flavors.me/mctiu078
flavors.me/rnecl749
flavors.me/ntewo928
flavors.me/iwbcq941
flavors.me/oqfwh692
flavors.me/tbjjy144
flavors.me/nyhkj401
flavors.me/wablz424
flavors.me/ydxzr624
flavors.me/aytnj811
flavors.me/fsxha363
flavors.me/jvunc376
flavors.me/sfoos389
flavors.me/uakcj579
flavors.me/vdgqb869
flavors.me/ffarr872
flavors.me/wahqu334
flavors.me/gcbrk337
flavors.me/xrkeo264
flavors.me/ddwzf735
flavors.me/egsnp015
flavors.me/gbobh005
flavors.me/ifcpr295
flavors.me/jaydj495
flavors.me/hfmlt213
flavors.me/etsse949
flavors.me/googw949
flavors.me/dbcgh767
flavors.me/fxqur957
flavors.me/ogkvp951
flavors.me/yqzzp479
flavors.me/dhage844
flavors.me/rhcnb108
flavors.me/mebhe418
flavors.me/eutua345
flavors.me/jfxpr896
flavors.me/torpp810
flavors.me/cqkqf813
flavors.me/adryq531
flavors.me/yiffb379
flavors.me/dujas021
flavors.me/ndcaq044
flavors.me/wtmom770
flavors.me/uyavx599
flavors.me/rdgdi237
flavors.me/fdikf792
flavors.me/ciwsq430
flavors.me/ibamh981
flavors.me/fhous700
flavors.me/duubd446
flavors.me/jfywu988
flavors.me/avpjy926
flavors.me/ggtvp468
flavors.me/pqnwf491
flavors.me/vbrqw942
flavors.me/wwneo132
flavors.me/gghfe135
flavors.me/dlnnp872
flavors.me/nuhof877
flavors.me/isghi165
flavors.me/cpeiu341
flavors.me/weckf816
flavors.me/xowlv719
flavors.me/vtksg557
flavors.me/anonx009
flavors.me/cikbp299
flavors.me/znqia917
flavors.me/fhcdr569
flavors.me/oiodh482
flavors.me/mvcls200
flavors.me/vxwmq223
flavors.me/fgimg236
flavors.me/dlwur975
flavors.me/knbzz440
flavors.me/mixnr637
flavors.me/nmtbb827
flavors.me/lrzim646
flavors.me/yqjpj820
flavors.me/isuqh824
flavors.me/ffjys662
flavors.me/lrmsj313
flavors.me/ikqma865
flavors.me/gpeul503
flavors.me/flmun345
flavors.me/lwyoe896
flavors.me/vfjpu710
flavors.me/slyxf536
flavors.me/oqxqi746
flavors.me/xsrrg749
flavors.me/hbdsw762
flavors.me/wborl260
flavors.me/qekfv230
flavors.me/vqnzm902
flavors.me/xtjne982
flavors.me/yofbn172
flavors.me/iyrcm195
flavors.me/rzldc108
flavors.me/bifva121
flavors.me/kkzwq124
flavors.me/qdcqh676
flavors.me/ksbss132
flavors.me/hypzd871
flavors.me/jbdnn871
flavors.me/kwzbf040
flavors.me/ugscv064
flavors.me/dhmdt077
flavors.me/vxwqp803
flavors.me/aiikg575
flavors.me/kyryc303
flavors.me/hdffn029
flavors.me/jgbtf219
flavors.me/sivuv212
flavors.me/crhvt246
flavors.me/emdjd435
flavors.me/fqzxv405
flavors.me/thbes980
flavors.me/igrzx995
flavors.me/emqsa183
flavors.me/nvktq106
flavors.me/fduym935
flavors.me/ggqme135
flavors.me/yohaa961
flavors.me/lthte151
flavors.me/fifvh416
flavors.me/oszvf339
flavors.me/uddqw080
flavors.me/wyzeg170
flavors.me/daeqp845
flavors.me/zgdks055
flavors.me/cjaqt077
flavors.me/mturr072
flavors.me/zqukm360
flavors.me/vwteq560
flavors.me/exneg573
flavors.me/ijklp786
flavors.me/bgdqc566
flavors.me/wsawm579
flavors.me/ozkki206
flavors.me/pvgys586
flavors.me/bmhue847