[{"data":1,"prerenderedAt":2693},["ShallowReactive",2],{"article-alternates":3,"article-\u002Ftr\u002Fdata\u002Fcohort-tablo-mimarisi-retention-analizinin-productionda-olceklenmesi":13},{"i18nKey":4,"paths":5},"data-007-2026-05",{"de":6,"en":7,"es":8,"fr":9,"it":10,"ru":11,"tr":12},"\u002Fde\u002Fdata\u002Fcohort-tabellenstruktur","\u002Fen\u002Fdata\u002Fcohort-table-architecture-scaling-retention-analysis-production","\u002Fes\u002Fdata\u002Farquitectura-tabla-cohort","\u002Ffr\u002Fdata\u002Fcohort-table-architecture","\u002Fit\u002Fdata\u002Farchitettura-tabella-cohort-retention-production","\u002Fru\u002Fdata\u002Fcohort-tablesql-architecture-production-retention","\u002Ftr\u002Fdata\u002Fcohort-tablo-mimarisi-retention-analizinin-productionda-olceklenmesi",{"_path":12,"_dir":14,"_draft":15,"_partial":15,"_locale":16,"title":17,"description":18,"publishedAt":19,"modifiedAt":19,"category":14,"i18nKey":4,"tags":20,"readingTime":26,"author":27,"body":28,"_type":2687,"_id":2688,"_source":2689,"_file":2690,"_stem":2691,"_extension":2692},"data",false,"","Cohort Tablo Mimarisi: Retention Analizinin Production'da Ölçeklenmesi","Materialized views, partitioning ve query cost optimization ile milyonlarca kullanıcı üzerinde cohort analizi yapmak: production-ready BigQuery mimarisi.","2026-05-22",[21,22,23,24,25],"cohort-analysis","bigquery","materialized-views","retention-engineering","query-optimization",8,"Roibase",{"type":29,"children":30,"toc":2677},"root",[31,39,46,51,531,544,550,578,670,675,681,686,848,861,866,1196,1201,1207,1212,1256,1261,2144,2160,2166,2171,2208,2213,2300,2305,2311,2316,2330,2335,2425,2430,2436,2441,2474,2488,2494,2499,2532,2537,2661,2666,2671],{"type":32,"tag":33,"props":34,"children":35},"element","p",{},[36],{"type":37,"value":38},"text","Retention analizi, kullanıcı davranışını anlamanın en güçlü yöntemlerinden biri. Ancak gerçek ölçekte — günde milyonlarca event, yüzbinlerce kullanıcı — naif SQL sorguları 30 saniyede timeout'a düşer veya slot kapasitesini tüketir. Production'da sürdürülebilir cohort analizi, tablo mimarisini sorgu motoruna göre optimize etmeyi gerektirir. Bu yazıda BigQuery üzerinde materialized view, partitioning ve incremental refresh stratejileriyle cohort tablolarını nasıl ölçeklendireceğinizi gösteriyoruz.",{"type":32,"tag":40,"props":41,"children":43},"h2",{"id":42},"naif-cohort-sorgusu-neden-çöker",[44],{"type":37,"value":45},"Naif Cohort Sorgusu Neden Çöker",{"type":32,"tag":33,"props":47,"children":48},{},[49],{"type":37,"value":50},"Klasik cohort analizi şu mantıkla çalışır: kullanıcının ilk aktivite tarihini (cohort_date) bul, sonraki tüm aktiviteleri bu tarihe göre \"N. gün\" olarak hesapla, retention oranını grup bazında topla. Aşağıdaki SQL, mantık olarak doğru ama production'da çalışmaz:",{"type":32,"tag":52,"props":53,"children":57},"pre",{"className":54,"code":55,"language":56,"meta":16,"style":16},"language-sql shiki shiki-themes github-dark","WITH first_event AS (\n  SELECT user_id, MIN(DATE(event_timestamp)) AS cohort_date\n  FROM `project.dataset.events`\n  GROUP BY user_id\n),\ndaily_activity AS (\n  SELECT e.user_id, DATE(e.event_timestamp) AS activity_date\n  FROM `project.dataset.events` e\n  GROUP BY 1,2\n)\nSELECT \n  f.cohort_date,\n  DATE_DIFF(d.activity_date, f.cohort_date, DAY) AS day_n,\n  COUNT(DISTINCT d.user_id) AS retained_users\nFROM first_event f\nJOIN daily_activity d USING(user_id)\nGROUP BY 1,2\nORDER BY 1,2;\n","sql",[58],{"type":32,"tag":59,"props":60,"children":61},"code",{"__ignoreMap":16},[62,90,134,149,163,172,189,253,270,293,302,316,339,401,445,459,483,504],{"type":32,"tag":63,"props":64,"children":67},"span",{"class":65,"line":66},"line",1,[68,74,80,85],{"type":32,"tag":63,"props":69,"children":71},{"style":70},"--shiki-default:#F97583",[72],{"type":37,"value":73},"WITH",{"type":32,"tag":63,"props":75,"children":77},{"style":76},"--shiki-default:#E1E4E8",[78],{"type":37,"value":79}," first_event ",{"type":32,"tag":63,"props":81,"children":82},{"style":70},[83],{"type":37,"value":84},"AS",{"type":32,"tag":63,"props":86,"children":87},{"style":76},[88],{"type":37,"value":89}," (\n",{"type":32,"tag":63,"props":91,"children":93},{"class":65,"line":92},2,[94,99,104,110,115,120,125,129],{"type":32,"tag":63,"props":95,"children":96},{"style":70},[97],{"type":37,"value":98},"  SELECT",{"type":32,"tag":63,"props":100,"children":101},{"style":76},[102],{"type":37,"value":103}," user_id, ",{"type":32,"tag":63,"props":105,"children":107},{"style":106},"--shiki-default:#79B8FF",[108],{"type":37,"value":109},"MIN",{"type":32,"tag":63,"props":111,"children":112},{"style":76},[113],{"type":37,"value":114},"(",{"type":32,"tag":63,"props":116,"children":117},{"style":70},[118],{"type":37,"value":119},"DATE",{"type":32,"tag":63,"props":121,"children":122},{"style":76},[123],{"type":37,"value":124},"(event_timestamp)) ",{"type":32,"tag":63,"props":126,"children":127},{"style":70},[128],{"type":37,"value":84},{"type":32,"tag":63,"props":130,"children":131},{"style":76},[132],{"type":37,"value":133}," cohort_date\n",{"type":32,"tag":63,"props":135,"children":137},{"class":65,"line":136},3,[138,143],{"type":32,"tag":63,"props":139,"children":140},{"style":70},[141],{"type":37,"value":142},"  FROM",{"type":32,"tag":63,"props":144,"children":146},{"style":145},"--shiki-default:#9ECBFF",[147],{"type":37,"value":148}," `project.dataset.events`\n",{"type":32,"tag":63,"props":150,"children":152},{"class":65,"line":151},4,[153,158],{"type":32,"tag":63,"props":154,"children":155},{"style":70},[156],{"type":37,"value":157},"  GROUP BY",{"type":32,"tag":63,"props":159,"children":160},{"style":76},[161],{"type":37,"value":162}," user_id\n",{"type":32,"tag":63,"props":164,"children":166},{"class":65,"line":165},5,[167],{"type":32,"tag":63,"props":168,"children":169},{"style":76},[170],{"type":37,"value":171},"),\n",{"type":32,"tag":63,"props":173,"children":175},{"class":65,"line":174},6,[176,181,185],{"type":32,"tag":63,"props":177,"children":178},{"style":76},[179],{"type":37,"value":180},"daily_activity ",{"type":32,"tag":63,"props":182,"children":183},{"style":70},[184],{"type":37,"value":84},{"type":32,"tag":63,"props":186,"children":187},{"style":76},[188],{"type":37,"value":89},{"type":32,"tag":63,"props":190,"children":192},{"class":65,"line":191},7,[193,197,202,207,212,217,221,225,230,234,239,244,248],{"type":32,"tag":63,"props":194,"children":195},{"style":70},[196],{"type":37,"value":98},{"type":32,"tag":63,"props":198,"children":199},{"style":106},[200],{"type":37,"value":201}," e",{"type":32,"tag":63,"props":203,"children":204},{"style":76},[205],{"type":37,"value":206},".",{"type":32,"tag":63,"props":208,"children":209},{"style":106},[210],{"type":37,"value":211},"user_id",{"type":32,"tag":63,"props":213,"children":214},{"style":76},[215],{"type":37,"value":216},", ",{"type":32,"tag":63,"props":218,"children":219},{"style":70},[220],{"type":37,"value":119},{"type":32,"tag":63,"props":222,"children":223},{"style":76},[224],{"type":37,"value":114},{"type":32,"tag":63,"props":226,"children":227},{"style":106},[228],{"type":37,"value":229},"e",{"type":32,"tag":63,"props":231,"children":232},{"style":76},[233],{"type":37,"value":206},{"type":32,"tag":63,"props":235,"children":236},{"style":106},[237],{"type":37,"value":238},"event_timestamp",{"type":32,"tag":63,"props":240,"children":241},{"style":76},[242],{"type":37,"value":243},") ",{"type":32,"tag":63,"props":245,"children":246},{"style":70},[247],{"type":37,"value":84},{"type":32,"tag":63,"props":249,"children":250},{"style":76},[251],{"type":37,"value":252}," activity_date\n",{"type":32,"tag":63,"props":254,"children":255},{"class":65,"line":26},[256,260,265],{"type":32,"tag":63,"props":257,"children":258},{"style":70},[259],{"type":37,"value":142},{"type":32,"tag":63,"props":261,"children":262},{"style":145},[263],{"type":37,"value":264}," `project.dataset.events`",{"type":32,"tag":63,"props":266,"children":267},{"style":76},[268],{"type":37,"value":269}," e\n",{"type":32,"tag":63,"props":271,"children":273},{"class":65,"line":272},9,[274,278,283,288],{"type":32,"tag":63,"props":275,"children":276},{"style":70},[277],{"type":37,"value":157},{"type":32,"tag":63,"props":279,"children":280},{"style":106},[281],{"type":37,"value":282}," 1",{"type":32,"tag":63,"props":284,"children":285},{"style":76},[286],{"type":37,"value":287},",",{"type":32,"tag":63,"props":289,"children":290},{"style":106},[291],{"type":37,"value":292},"2\n",{"type":32,"tag":63,"props":294,"children":296},{"class":65,"line":295},10,[297],{"type":32,"tag":63,"props":298,"children":299},{"style":76},[300],{"type":37,"value":301},")\n",{"type":32,"tag":63,"props":303,"children":305},{"class":65,"line":304},11,[306,311],{"type":32,"tag":63,"props":307,"children":308},{"style":70},[309],{"type":37,"value":310},"SELECT",{"type":32,"tag":63,"props":312,"children":313},{"style":76},[314],{"type":37,"value":315}," \n",{"type":32,"tag":63,"props":317,"children":319},{"class":65,"line":318},12,[320,325,329,334],{"type":32,"tag":63,"props":321,"children":322},{"style":106},[323],{"type":37,"value":324},"  f",{"type":32,"tag":63,"props":326,"children":327},{"style":76},[328],{"type":37,"value":206},{"type":32,"tag":63,"props":330,"children":331},{"style":106},[332],{"type":37,"value":333},"cohort_date",{"type":32,"tag":63,"props":335,"children":336},{"style":76},[337],{"type":37,"value":338},",\n",{"type":32,"tag":63,"props":340,"children":342},{"class":65,"line":341},13,[343,348,353,357,362,366,371,375,379,383,388,392,396],{"type":32,"tag":63,"props":344,"children":345},{"style":76},[346],{"type":37,"value":347},"  DATE_DIFF(",{"type":32,"tag":63,"props":349,"children":350},{"style":106},[351],{"type":37,"value":352},"d",{"type":32,"tag":63,"props":354,"children":355},{"style":76},[356],{"type":37,"value":206},{"type":32,"tag":63,"props":358,"children":359},{"style":106},[360],{"type":37,"value":361},"activity_date",{"type":32,"tag":63,"props":363,"children":364},{"style":76},[365],{"type":37,"value":216},{"type":32,"tag":63,"props":367,"children":368},{"style":106},[369],{"type":37,"value":370},"f",{"type":32,"tag":63,"props":372,"children":373},{"style":76},[374],{"type":37,"value":206},{"type":32,"tag":63,"props":376,"children":377},{"style":106},[378],{"type":37,"value":333},{"type":32,"tag":63,"props":380,"children":381},{"style":76},[382],{"type":37,"value":216},{"type":32,"tag":63,"props":384,"children":385},{"style":70},[386],{"type":37,"value":387},"DAY",{"type":32,"tag":63,"props":389,"children":390},{"style":76},[391],{"type":37,"value":243},{"type":32,"tag":63,"props":393,"children":394},{"style":70},[395],{"type":37,"value":84},{"type":32,"tag":63,"props":397,"children":398},{"style":76},[399],{"type":37,"value":400}," day_n,\n",{"type":32,"tag":63,"props":402,"children":404},{"class":65,"line":403},14,[405,410,414,419,424,428,432,436,440],{"type":32,"tag":63,"props":406,"children":407},{"style":106},[408],{"type":37,"value":409},"  COUNT",{"type":32,"tag":63,"props":411,"children":412},{"style":76},[413],{"type":37,"value":114},{"type":32,"tag":63,"props":415,"children":416},{"style":70},[417],{"type":37,"value":418},"DISTINCT",{"type":32,"tag":63,"props":420,"children":421},{"style":106},[422],{"type":37,"value":423}," d",{"type":32,"tag":63,"props":425,"children":426},{"style":76},[427],{"type":37,"value":206},{"type":32,"tag":63,"props":429,"children":430},{"style":106},[431],{"type":37,"value":211},{"type":32,"tag":63,"props":433,"children":434},{"style":76},[435],{"type":37,"value":243},{"type":32,"tag":63,"props":437,"children":438},{"style":70},[439],{"type":37,"value":84},{"type":32,"tag":63,"props":441,"children":442},{"style":76},[443],{"type":37,"value":444}," retained_users\n",{"type":32,"tag":63,"props":446,"children":448},{"class":65,"line":447},15,[449,454],{"type":32,"tag":63,"props":450,"children":451},{"style":70},[452],{"type":37,"value":453},"FROM",{"type":32,"tag":63,"props":455,"children":456},{"style":76},[457],{"type":37,"value":458}," first_event f\n",{"type":32,"tag":63,"props":460,"children":462},{"class":65,"line":461},16,[463,468,473,478],{"type":32,"tag":63,"props":464,"children":465},{"style":70},[466],{"type":37,"value":467},"JOIN",{"type":32,"tag":63,"props":469,"children":470},{"style":76},[471],{"type":37,"value":472}," daily_activity d ",{"type":32,"tag":63,"props":474,"children":475},{"style":70},[476],{"type":37,"value":477},"USING",{"type":32,"tag":63,"props":479,"children":480},{"style":76},[481],{"type":37,"value":482},"(user_id)\n",{"type":32,"tag":63,"props":484,"children":486},{"class":65,"line":485},17,[487,492,496,500],{"type":32,"tag":63,"props":488,"children":489},{"style":70},[490],{"type":37,"value":491},"GROUP BY",{"type":32,"tag":63,"props":493,"children":494},{"style":106},[495],{"type":37,"value":282},{"type":32,"tag":63,"props":497,"children":498},{"style":76},[499],{"type":37,"value":287},{"type":32,"tag":63,"props":501,"children":502},{"style":106},[503],{"type":37,"value":292},{"type":32,"tag":63,"props":505,"children":507},{"class":65,"line":506},18,[508,513,517,521,526],{"type":32,"tag":63,"props":509,"children":510},{"style":70},[511],{"type":37,"value":512},"ORDER BY",{"type":32,"tag":63,"props":514,"children":515},{"style":106},[516],{"type":37,"value":282},{"type":32,"tag":63,"props":518,"children":519},{"style":76},[520],{"type":37,"value":287},{"type":32,"tag":63,"props":522,"children":523},{"style":106},[524],{"type":37,"value":525},"2",{"type":32,"tag":63,"props":527,"children":528},{"style":76},[529],{"type":37,"value":530},";\n",{"type":32,"tag":33,"props":532,"children":533},{},[534,536,542],{"type":37,"value":535},"Bu sorguda iki büyük sorun var: (1) ",{"type":32,"tag":59,"props":537,"children":539},{"className":538},[],[540],{"type":37,"value":541},"events",{"type":37,"value":543}," tablosu her seferinde tam taranır — partition pruning yok, (2) her cohort_date için tüm kullanıcıların tüm aktiviteleri join edilir — kartezyen patlama riski. 100M event'te bu sorgu 400GB veri işler ve 2 dakikada biter, ancak günlük refresh'te bu sürdürülebilir değil. BigQuery faturası ay sonunda 10x'e çıkar.",{"type":32,"tag":40,"props":545,"children":547},{"id":546},"partitioned-base-table-ile-filtreleme-yükünü-düşürmek",[548],{"type":37,"value":549},"Partitioned Base Table ile Filtreleme Yükünü Düşürmek",{"type":32,"tag":33,"props":551,"children":552},{},[553,555,560,562,568,570,576],{"type":37,"value":554},"İlk adım: ",{"type":32,"tag":59,"props":556,"children":558},{"className":557},[],[559],{"type":37,"value":541},{"type":37,"value":561}," tablosunu ",{"type":32,"tag":59,"props":563,"children":565},{"className":564},[],[566],{"type":37,"value":567},"DATE(event_timestamp)",{"type":37,"value":569}," üzerinden partition etmek. Bu, sorguya ",{"type":32,"tag":59,"props":571,"children":573},{"className":572},[],[574],{"type":37,"value":575},"WHERE DATE(event_timestamp) BETWEEN X AND Y",{"type":37,"value":577}," koşulu eklendiğinde sadece ilgili partition'ların taranmasını sağlar:",{"type":32,"tag":52,"props":579,"children":581},{"className":54,"code":580,"language":56,"meta":16,"style":16},"CREATE TABLE `project.dataset.events`\nPARTITION BY DATE(event_timestamp)\nCLUSTER BY user_id, event_name\nAS SELECT * FROM ...;\n",[582],{"type":32,"tag":59,"props":583,"children":584},{"__ignoreMap":16},[585,602,625,643],{"type":32,"tag":63,"props":586,"children":587},{"class":65,"line":66},[588,593,598],{"type":32,"tag":63,"props":589,"children":590},{"style":70},[591],{"type":37,"value":592},"CREATE",{"type":32,"tag":63,"props":594,"children":595},{"style":70},[596],{"type":37,"value":597}," TABLE",{"type":32,"tag":63,"props":599,"children":600},{"style":145},[601],{"type":37,"value":148},{"type":32,"tag":63,"props":603,"children":604},{"class":65,"line":92},[605,610,615,620],{"type":32,"tag":63,"props":606,"children":607},{"style":70},[608],{"type":37,"value":609},"PARTITION",{"type":32,"tag":63,"props":611,"children":612},{"style":70},[613],{"type":37,"value":614}," BY",{"type":32,"tag":63,"props":616,"children":617},{"style":70},[618],{"type":37,"value":619}," DATE",{"type":32,"tag":63,"props":621,"children":622},{"style":76},[623],{"type":37,"value":624},"(event_timestamp)\n",{"type":32,"tag":63,"props":626,"children":627},{"class":65,"line":136},[628,633,638],{"type":32,"tag":63,"props":629,"children":630},{"style":76},[631],{"type":37,"value":632},"CLUSTER ",{"type":32,"tag":63,"props":634,"children":635},{"style":70},[636],{"type":37,"value":637},"BY",{"type":32,"tag":63,"props":639,"children":640},{"style":76},[641],{"type":37,"value":642}," user_id, event_name\n",{"type":32,"tag":63,"props":644,"children":645},{"class":65,"line":151},[646,650,655,660,665],{"type":32,"tag":63,"props":647,"children":648},{"style":70},[649],{"type":37,"value":84},{"type":32,"tag":63,"props":651,"children":652},{"style":70},[653],{"type":37,"value":654}," SELECT",{"type":32,"tag":63,"props":656,"children":657},{"style":70},[658],{"type":37,"value":659}," *",{"type":32,"tag":63,"props":661,"children":662},{"style":70},[663],{"type":37,"value":664}," FROM",{"type":32,"tag":63,"props":666,"children":667},{"style":76},[668],{"type":37,"value":669}," ...;\n",{"type":32,"tag":33,"props":671,"children":672},{},[673],{"type":37,"value":674},"Clustering (user_id, event_name) eklenmesi, aynı kullanıcının event'lerinin fiziksel olarak yakın bloklarda saklanmasını sağlar — join performansı %30-50 artar. Ancak bu tek başına yeterli değil; cohort hesaplama mantığı her sorguda tekrar çalışır. Burası materialized view'ın devreye girdiği nokta.",{"type":32,"tag":40,"props":676,"children":678},{"id":677},"materialized-view-incremental-cohort-tablosu",[679],{"type":37,"value":680},"Materialized View: Incremental Cohort Tablosu",{"type":32,"tag":33,"props":682,"children":683},{},[684],{"type":37,"value":685},"BigQuery'nin materialized view'ları, sorgu sonucunu fiziksel olarak saklar ve base table'da değişiklik oldukça otomatik refresh yapar. Cohort analizinde şu yapıyı kullanıyoruz:",{"type":32,"tag":52,"props":687,"children":689},{"className":54,"code":688,"language":56,"meta":16,"style":16},"CREATE MATERIALIZED VIEW `project.dataset.user_cohorts`\nPARTITION BY cohort_date\nCLUSTER BY user_id\nAS\nSELECT \n  user_id,\n  MIN(DATE(event_timestamp)) AS cohort_date,\n  COUNT(*) AS first_day_events\nFROM `project.dataset.events`\nGROUP BY user_id;\n",[690],{"type":32,"tag":59,"props":691,"children":692},{"__ignoreMap":16},[693,710,725,740,748,759,767,796,825,836],{"type":32,"tag":63,"props":694,"children":695},{"class":65,"line":66},[696,700,705],{"type":32,"tag":63,"props":697,"children":698},{"style":70},[699],{"type":37,"value":592},{"type":32,"tag":63,"props":701,"children":702},{"style":76},[703],{"type":37,"value":704}," MATERIALIZED VIEW ",{"type":32,"tag":63,"props":706,"children":707},{"style":145},[708],{"type":37,"value":709},"`project.dataset.user_cohorts`\n",{"type":32,"tag":63,"props":711,"children":712},{"class":65,"line":92},[713,717,721],{"type":32,"tag":63,"props":714,"children":715},{"style":70},[716],{"type":37,"value":609},{"type":32,"tag":63,"props":718,"children":719},{"style":70},[720],{"type":37,"value":614},{"type":32,"tag":63,"props":722,"children":723},{"style":76},[724],{"type":37,"value":133},{"type":32,"tag":63,"props":726,"children":727},{"class":65,"line":136},[728,732,736],{"type":32,"tag":63,"props":729,"children":730},{"style":76},[731],{"type":37,"value":632},{"type":32,"tag":63,"props":733,"children":734},{"style":70},[735],{"type":37,"value":637},{"type":32,"tag":63,"props":737,"children":738},{"style":76},[739],{"type":37,"value":162},{"type":32,"tag":63,"props":741,"children":742},{"class":65,"line":151},[743],{"type":32,"tag":63,"props":744,"children":745},{"style":70},[746],{"type":37,"value":747},"AS\n",{"type":32,"tag":63,"props":749,"children":750},{"class":65,"line":165},[751,755],{"type":32,"tag":63,"props":752,"children":753},{"style":70},[754],{"type":37,"value":310},{"type":32,"tag":63,"props":756,"children":757},{"style":76},[758],{"type":37,"value":315},{"type":32,"tag":63,"props":760,"children":761},{"class":65,"line":174},[762],{"type":32,"tag":63,"props":763,"children":764},{"style":76},[765],{"type":37,"value":766},"  user_id,\n",{"type":32,"tag":63,"props":768,"children":769},{"class":65,"line":191},[770,775,779,783,787,791],{"type":32,"tag":63,"props":771,"children":772},{"style":106},[773],{"type":37,"value":774},"  MIN",{"type":32,"tag":63,"props":776,"children":777},{"style":76},[778],{"type":37,"value":114},{"type":32,"tag":63,"props":780,"children":781},{"style":70},[782],{"type":37,"value":119},{"type":32,"tag":63,"props":784,"children":785},{"style":76},[786],{"type":37,"value":124},{"type":32,"tag":63,"props":788,"children":789},{"style":70},[790],{"type":37,"value":84},{"type":32,"tag":63,"props":792,"children":793},{"style":76},[794],{"type":37,"value":795}," cohort_date,\n",{"type":32,"tag":63,"props":797,"children":798},{"class":65,"line":26},[799,803,807,812,816,820],{"type":32,"tag":63,"props":800,"children":801},{"style":106},[802],{"type":37,"value":409},{"type":32,"tag":63,"props":804,"children":805},{"style":76},[806],{"type":37,"value":114},{"type":32,"tag":63,"props":808,"children":809},{"style":70},[810],{"type":37,"value":811},"*",{"type":32,"tag":63,"props":813,"children":814},{"style":76},[815],{"type":37,"value":243},{"type":32,"tag":63,"props":817,"children":818},{"style":70},[819],{"type":37,"value":84},{"type":32,"tag":63,"props":821,"children":822},{"style":76},[823],{"type":37,"value":824}," first_day_events\n",{"type":32,"tag":63,"props":826,"children":827},{"class":65,"line":272},[828,832],{"type":32,"tag":63,"props":829,"children":830},{"style":70},[831],{"type":37,"value":453},{"type":32,"tag":63,"props":833,"children":834},{"style":145},[835],{"type":37,"value":148},{"type":32,"tag":63,"props":837,"children":838},{"class":65,"line":295},[839,843],{"type":32,"tag":63,"props":840,"children":841},{"style":70},[842],{"type":37,"value":491},{"type":32,"tag":63,"props":844,"children":845},{"style":76},[846],{"type":37,"value":847}," user_id;\n",{"type":32,"tag":33,"props":849,"children":850},{},[851,853,859],{"type":37,"value":852},"Bu view, her kullanıcının ilk görüldüğü tarihi (cohort_date) bir kez hesaplar ve saklar. Yeni event geldiğinde BigQuery sadece delta'yı işler — tam tarama olmaz. Partition by cohort_date, retention sorgularında ",{"type":32,"tag":59,"props":854,"children":856},{"className":855},[],[857],{"type":37,"value":858},"WHERE cohort_date = '2026-05-01'",{"type":37,"value":860}," gibi filtrelerde pruning yapılmasını sağlar.",{"type":32,"tag":33,"props":862,"children":863},{},[864],{"type":37,"value":865},"Şimdi retention hesaplama sorgusu şuna indirgenir:",{"type":32,"tag":52,"props":867,"children":869},{"className":54,"code":868,"language":56,"meta":16,"style":16},"SELECT \n  c.cohort_date,\n  DATE_DIFF(DATE(e.event_timestamp), c.cohort_date, DAY) AS day_n,\n  COUNT(DISTINCT e.user_id) AS retained_users\nFROM `project.dataset.user_cohorts` c\nJOIN `project.dataset.events` e \n  ON c.user_id = e.user_id \n  AND DATE(e.event_timestamp) >= c.cohort_date\nWHERE c.cohort_date BETWEEN '2026-05-01' AND '2026-05-15'\nGROUP BY 1,2;\n",[870],{"type":32,"tag":59,"props":871,"children":872},{"__ignoreMap":16},[873,884,904,969,1008,1025,1041,1083,1133,1173],{"type":32,"tag":63,"props":874,"children":875},{"class":65,"line":66},[876,880],{"type":32,"tag":63,"props":877,"children":878},{"style":70},[879],{"type":37,"value":310},{"type":32,"tag":63,"props":881,"children":882},{"style":76},[883],{"type":37,"value":315},{"type":32,"tag":63,"props":885,"children":886},{"class":65,"line":92},[887,892,896,900],{"type":32,"tag":63,"props":888,"children":889},{"style":106},[890],{"type":37,"value":891},"  c",{"type":32,"tag":63,"props":893,"children":894},{"style":76},[895],{"type":37,"value":206},{"type":32,"tag":63,"props":897,"children":898},{"style":106},[899],{"type":37,"value":333},{"type":32,"tag":63,"props":901,"children":902},{"style":76},[903],{"type":37,"value":338},{"type":32,"tag":63,"props":905,"children":906},{"class":65,"line":136},[907,911,915,919,923,927,931,936,941,945,949,953,957,961,965],{"type":32,"tag":63,"props":908,"children":909},{"style":76},[910],{"type":37,"value":347},{"type":32,"tag":63,"props":912,"children":913},{"style":70},[914],{"type":37,"value":119},{"type":32,"tag":63,"props":916,"children":917},{"style":76},[918],{"type":37,"value":114},{"type":32,"tag":63,"props":920,"children":921},{"style":106},[922],{"type":37,"value":229},{"type":32,"tag":63,"props":924,"children":925},{"style":76},[926],{"type":37,"value":206},{"type":32,"tag":63,"props":928,"children":929},{"style":106},[930],{"type":37,"value":238},{"type":32,"tag":63,"props":932,"children":933},{"style":76},[934],{"type":37,"value":935},"), ",{"type":32,"tag":63,"props":937,"children":938},{"style":106},[939],{"type":37,"value":940},"c",{"type":32,"tag":63,"props":942,"children":943},{"style":76},[944],{"type":37,"value":206},{"type":32,"tag":63,"props":946,"children":947},{"style":106},[948],{"type":37,"value":333},{"type":32,"tag":63,"props":950,"children":951},{"style":76},[952],{"type":37,"value":216},{"type":32,"tag":63,"props":954,"children":955},{"style":70},[956],{"type":37,"value":387},{"type":32,"tag":63,"props":958,"children":959},{"style":76},[960],{"type":37,"value":243},{"type":32,"tag":63,"props":962,"children":963},{"style":70},[964],{"type":37,"value":84},{"type":32,"tag":63,"props":966,"children":967},{"style":76},[968],{"type":37,"value":400},{"type":32,"tag":63,"props":970,"children":971},{"class":65,"line":151},[972,976,980,984,988,992,996,1000,1004],{"type":32,"tag":63,"props":973,"children":974},{"style":106},[975],{"type":37,"value":409},{"type":32,"tag":63,"props":977,"children":978},{"style":76},[979],{"type":37,"value":114},{"type":32,"tag":63,"props":981,"children":982},{"style":70},[983],{"type":37,"value":418},{"type":32,"tag":63,"props":985,"children":986},{"style":106},[987],{"type":37,"value":201},{"type":32,"tag":63,"props":989,"children":990},{"style":76},[991],{"type":37,"value":206},{"type":32,"tag":63,"props":993,"children":994},{"style":106},[995],{"type":37,"value":211},{"type":32,"tag":63,"props":997,"children":998},{"style":76},[999],{"type":37,"value":243},{"type":32,"tag":63,"props":1001,"children":1002},{"style":70},[1003],{"type":37,"value":84},{"type":32,"tag":63,"props":1005,"children":1006},{"style":76},[1007],{"type":37,"value":444},{"type":32,"tag":63,"props":1009,"children":1010},{"class":65,"line":165},[1011,1015,1020],{"type":32,"tag":63,"props":1012,"children":1013},{"style":70},[1014],{"type":37,"value":453},{"type":32,"tag":63,"props":1016,"children":1017},{"style":145},[1018],{"type":37,"value":1019}," `project.dataset.user_cohorts`",{"type":32,"tag":63,"props":1021,"children":1022},{"style":76},[1023],{"type":37,"value":1024}," c\n",{"type":32,"tag":63,"props":1026,"children":1027},{"class":65,"line":174},[1028,1032,1036],{"type":32,"tag":63,"props":1029,"children":1030},{"style":70},[1031],{"type":37,"value":467},{"type":32,"tag":63,"props":1033,"children":1034},{"style":145},[1035],{"type":37,"value":264},{"type":32,"tag":63,"props":1037,"children":1038},{"style":76},[1039],{"type":37,"value":1040}," e \n",{"type":32,"tag":63,"props":1042,"children":1043},{"class":65,"line":191},[1044,1049,1054,1058,1062,1067,1071,1075,1079],{"type":32,"tag":63,"props":1045,"children":1046},{"style":70},[1047],{"type":37,"value":1048},"  ON",{"type":32,"tag":63,"props":1050,"children":1051},{"style":106},[1052],{"type":37,"value":1053}," c",{"type":32,"tag":63,"props":1055,"children":1056},{"style":76},[1057],{"type":37,"value":206},{"type":32,"tag":63,"props":1059,"children":1060},{"style":106},[1061],{"type":37,"value":211},{"type":32,"tag":63,"props":1063,"children":1064},{"style":70},[1065],{"type":37,"value":1066}," =",{"type":32,"tag":63,"props":1068,"children":1069},{"style":106},[1070],{"type":37,"value":201},{"type":32,"tag":63,"props":1072,"children":1073},{"style":76},[1074],{"type":37,"value":206},{"type":32,"tag":63,"props":1076,"children":1077},{"style":106},[1078],{"type":37,"value":211},{"type":32,"tag":63,"props":1080,"children":1081},{"style":76},[1082],{"type":37,"value":315},{"type":32,"tag":63,"props":1084,"children":1085},{"class":65,"line":26},[1086,1091,1095,1099,1103,1107,1111,1115,1120,1124,1128],{"type":32,"tag":63,"props":1087,"children":1088},{"style":70},[1089],{"type":37,"value":1090},"  AND",{"type":32,"tag":63,"props":1092,"children":1093},{"style":70},[1094],{"type":37,"value":619},{"type":32,"tag":63,"props":1096,"children":1097},{"style":76},[1098],{"type":37,"value":114},{"type":32,"tag":63,"props":1100,"children":1101},{"style":106},[1102],{"type":37,"value":229},{"type":32,"tag":63,"props":1104,"children":1105},{"style":76},[1106],{"type":37,"value":206},{"type":32,"tag":63,"props":1108,"children":1109},{"style":106},[1110],{"type":37,"value":238},{"type":32,"tag":63,"props":1112,"children":1113},{"style":76},[1114],{"type":37,"value":243},{"type":32,"tag":63,"props":1116,"children":1117},{"style":70},[1118],{"type":37,"value":1119},">=",{"type":32,"tag":63,"props":1121,"children":1122},{"style":106},[1123],{"type":37,"value":1053},{"type":32,"tag":63,"props":1125,"children":1126},{"style":76},[1127],{"type":37,"value":206},{"type":32,"tag":63,"props":1129,"children":1130},{"style":106},[1131],{"type":37,"value":1132},"cohort_date\n",{"type":32,"tag":63,"props":1134,"children":1135},{"class":65,"line":272},[1136,1141,1145,1149,1153,1158,1163,1168],{"type":32,"tag":63,"props":1137,"children":1138},{"style":70},[1139],{"type":37,"value":1140},"WHERE",{"type":32,"tag":63,"props":1142,"children":1143},{"style":106},[1144],{"type":37,"value":1053},{"type":32,"tag":63,"props":1146,"children":1147},{"style":76},[1148],{"type":37,"value":206},{"type":32,"tag":63,"props":1150,"children":1151},{"style":106},[1152],{"type":37,"value":333},{"type":32,"tag":63,"props":1154,"children":1155},{"style":70},[1156],{"type":37,"value":1157}," BETWEEN",{"type":32,"tag":63,"props":1159,"children":1160},{"style":145},[1161],{"type":37,"value":1162}," '2026-05-01'",{"type":32,"tag":63,"props":1164,"children":1165},{"style":70},[1166],{"type":37,"value":1167}," AND",{"type":32,"tag":63,"props":1169,"children":1170},{"style":145},[1171],{"type":37,"value":1172}," '2026-05-15'\n",{"type":32,"tag":63,"props":1174,"children":1175},{"class":65,"line":295},[1176,1180,1184,1188,1192],{"type":32,"tag":63,"props":1177,"children":1178},{"style":70},[1179],{"type":37,"value":491},{"type":32,"tag":63,"props":1181,"children":1182},{"style":106},[1183],{"type":37,"value":282},{"type":32,"tag":63,"props":1185,"children":1186},{"style":76},[1187],{"type":37,"value":287},{"type":32,"tag":63,"props":1189,"children":1190},{"style":106},[1191],{"type":37,"value":525},{"type":32,"tag":63,"props":1193,"children":1194},{"style":76},[1195],{"type":37,"value":530},{"type":32,"tag":33,"props":1197,"children":1198},{},[1199],{"type":37,"value":1200},"Bu sorgu, base table yerine materialized view'a join yapar — taranacak satır sayısı milyonlardan binlere iner. Ancak yine de günlük event tablosunu tarar. Bir sonraki aşamada pre-aggregate retention tablosu oluşturuyoruz.",{"type":32,"tag":40,"props":1202,"children":1204},{"id":1203},"pre-aggregated-retention-table-son-katman",[1205],{"type":37,"value":1206},"Pre-Aggregated Retention Table: Son Katman",{"type":32,"tag":33,"props":1208,"children":1209},{},[1210],{"type":37,"value":1211},"Cohort analizi genelde \"Day 0, Day 1, Day 7, Day 30\" gibi sabit aralıklarda bakılır — her gün için ayrı hesaplama yapmaya gerek yok. dbt ile şu mantığı uyguluyoruz:",{"type":32,"tag":1213,"props":1214,"children":1215},"ol",{},[1216,1230,1235],{"type":32,"tag":1217,"props":1218,"children":1219},"li",{},[1220,1222,1228],{"type":37,"value":1221},"Her gün, yeni cohort'ları ",{"type":32,"tag":59,"props":1223,"children":1225},{"className":1224},[],[1226],{"type":37,"value":1227},"user_cohorts",{"type":37,"value":1229}," view'ından çek",{"type":32,"tag":1217,"props":1231,"children":1232},{},[1233],{"type":37,"value":1234},"Her cohort için geçmiş 30 günlük retention'ı hesapla (ilk 30 gün dolduktan sonra değişmez)",{"type":32,"tag":1217,"props":1236,"children":1237},{},[1238,1240,1246,1248,1254],{"type":37,"value":1239},"Sonucu ",{"type":32,"tag":59,"props":1241,"children":1243},{"className":1242},[],[1244],{"type":37,"value":1245},"cohort_retention_summary",{"type":37,"value":1247}," tablosuna ",{"type":32,"tag":1249,"props":1250,"children":1251},"strong",{},[1252],{"type":37,"value":1253},"incremental",{"type":37,"value":1255}," yaz",{"type":32,"tag":33,"props":1257,"children":1258},{},[1259],{"type":37,"value":1260},"dbt modeli:",{"type":32,"tag":52,"props":1262,"children":1264},{"className":54,"code":1263,"language":56,"meta":16,"style":16},"{{\n  config(\n    materialized='incremental',\n    unique_key=['cohort_date','day_n'],\n    partition_by={'field':'cohort_date','data_type':'date'},\n    cluster_by=['day_n']\n  )\n}}\n\nWITH cohorts_to_update AS (\n  SELECT DISTINCT cohort_date \n  FROM {{ ref('user_cohorts') }}\n  WHERE cohort_date >= CURRENT_DATE() - 31\n  {% if is_incremental() %}\n    AND cohort_date > (SELECT MAX(cohort_date) FROM {{ this }})\n  {% endif %}\n),\nretention_calc AS (\n  SELECT \n    c.cohort_date,\n    DATE_DIFF(DATE(e.event_timestamp), c.cohort_date, DAY) AS day_n,\n    COUNT(DISTINCT e.user_id) AS retained_users,\n    MAX(c.first_day_events) AS cohort_size\n  FROM {{ ref('user_cohorts') }} c\n  JOIN {{ source('raw','events') }} e \n    ON c.user_id = e.user_id\n  WHERE c.cohort_date IN (SELECT cohort_date FROM cohorts_to_update)\n    AND DATE(e.event_timestamp) >= c.cohort_date\n    AND DATE_DIFF(DATE(e.event_timestamp), c.cohort_date, DAY) \u003C= 30\n  GROUP BY 1,2\n)\nSELECT \n  cohort_date,\n  day_n,\n  retained_users,\n  cohort_size,\n  SAFE_DIVIDE(retained_users, cohort_size) AS retention_rate\nFROM retention_calc;\n",[1265],{"type":32,"tag":59,"props":1266,"children":1267},{"__ignoreMap":16},[1268,1276,1284,1306,1323,1378,1395,1403,1411,1420,1440,1453,1475,1507,1525,1570,1578,1585,1601,1613,1634,1699,1741,1780,1801,1834,1872,1918,1966,2037,2057,2065,2077,2086,2095,2104,2113,2131],{"type":32,"tag":63,"props":1269,"children":1270},{"class":65,"line":66},[1271],{"type":32,"tag":63,"props":1272,"children":1273},{"style":76},[1274],{"type":37,"value":1275},"{{\n",{"type":32,"tag":63,"props":1277,"children":1278},{"class":65,"line":92},[1279],{"type":32,"tag":63,"props":1280,"children":1281},{"style":76},[1282],{"type":37,"value":1283},"  config(\n",{"type":32,"tag":63,"props":1285,"children":1286},{"class":65,"line":136},[1287,1292,1297,1302],{"type":32,"tag":63,"props":1288,"children":1289},{"style":76},[1290],{"type":37,"value":1291},"    materialized",{"type":32,"tag":63,"props":1293,"children":1294},{"style":70},[1295],{"type":37,"value":1296},"=",{"type":32,"tag":63,"props":1298,"children":1299},{"style":145},[1300],{"type":37,"value":1301},"'incremental'",{"type":32,"tag":63,"props":1303,"children":1304},{"style":76},[1305],{"type":37,"value":338},{"type":32,"tag":63,"props":1307,"children":1308},{"class":65,"line":151},[1309,1314,1318],{"type":32,"tag":63,"props":1310,"children":1311},{"style":76},[1312],{"type":37,"value":1313},"    unique_key",{"type":32,"tag":63,"props":1315,"children":1316},{"style":70},[1317],{"type":37,"value":1296},{"type":32,"tag":63,"props":1319,"children":1320},{"style":76},[1321],{"type":37,"value":1322},"['cohort_date','day_n'],\n",{"type":32,"tag":63,"props":1324,"children":1325},{"class":65,"line":165},[1326,1331,1335,1340,1345,1350,1355,1359,1364,1368,1373],{"type":32,"tag":63,"props":1327,"children":1328},{"style":76},[1329],{"type":37,"value":1330},"    partition_by",{"type":32,"tag":63,"props":1332,"children":1333},{"style":70},[1334],{"type":37,"value":1296},{"type":32,"tag":63,"props":1336,"children":1337},{"style":76},[1338],{"type":37,"value":1339},"{",{"type":32,"tag":63,"props":1341,"children":1342},{"style":145},[1343],{"type":37,"value":1344},"'field'",{"type":32,"tag":63,"props":1346,"children":1347},{"style":76},[1348],{"type":37,"value":1349},":",{"type":32,"tag":63,"props":1351,"children":1352},{"style":145},[1353],{"type":37,"value":1354},"'cohort_date'",{"type":32,"tag":63,"props":1356,"children":1357},{"style":76},[1358],{"type":37,"value":287},{"type":32,"tag":63,"props":1360,"children":1361},{"style":145},[1362],{"type":37,"value":1363},"'data_type'",{"type":32,"tag":63,"props":1365,"children":1366},{"style":76},[1367],{"type":37,"value":1349},{"type":32,"tag":63,"props":1369,"children":1370},{"style":145},[1371],{"type":37,"value":1372},"'date'",{"type":32,"tag":63,"props":1374,"children":1375},{"style":76},[1376],{"type":37,"value":1377},"},\n",{"type":32,"tag":63,"props":1379,"children":1380},{"class":65,"line":174},[1381,1386,1390],{"type":32,"tag":63,"props":1382,"children":1383},{"style":76},[1384],{"type":37,"value":1385},"    cluster_by",{"type":32,"tag":63,"props":1387,"children":1388},{"style":70},[1389],{"type":37,"value":1296},{"type":32,"tag":63,"props":1391,"children":1392},{"style":76},[1393],{"type":37,"value":1394},"['day_n']\n",{"type":32,"tag":63,"props":1396,"children":1397},{"class":65,"line":191},[1398],{"type":32,"tag":63,"props":1399,"children":1400},{"style":76},[1401],{"type":37,"value":1402},"  )\n",{"type":32,"tag":63,"props":1404,"children":1405},{"class":65,"line":26},[1406],{"type":32,"tag":63,"props":1407,"children":1408},{"style":76},[1409],{"type":37,"value":1410},"}}\n",{"type":32,"tag":63,"props":1412,"children":1413},{"class":65,"line":272},[1414],{"type":32,"tag":63,"props":1415,"children":1417},{"emptyLinePlaceholder":1416},true,[1418],{"type":37,"value":1419},"\n",{"type":32,"tag":63,"props":1421,"children":1422},{"class":65,"line":295},[1423,1427,1432,1436],{"type":32,"tag":63,"props":1424,"children":1425},{"style":70},[1426],{"type":37,"value":73},{"type":32,"tag":63,"props":1428,"children":1429},{"style":76},[1430],{"type":37,"value":1431}," cohorts_to_update ",{"type":32,"tag":63,"props":1433,"children":1434},{"style":70},[1435],{"type":37,"value":84},{"type":32,"tag":63,"props":1437,"children":1438},{"style":76},[1439],{"type":37,"value":89},{"type":32,"tag":63,"props":1441,"children":1442},{"class":65,"line":304},[1443,1448],{"type":32,"tag":63,"props":1444,"children":1445},{"style":70},[1446],{"type":37,"value":1447},"  SELECT DISTINCT",{"type":32,"tag":63,"props":1449,"children":1450},{"style":76},[1451],{"type":37,"value":1452}," cohort_date \n",{"type":32,"tag":63,"props":1454,"children":1455},{"class":65,"line":318},[1456,1460,1465,1470],{"type":32,"tag":63,"props":1457,"children":1458},{"style":70},[1459],{"type":37,"value":142},{"type":32,"tag":63,"props":1461,"children":1462},{"style":76},[1463],{"type":37,"value":1464}," {{ ref(",{"type":32,"tag":63,"props":1466,"children":1467},{"style":145},[1468],{"type":37,"value":1469},"'user_cohorts'",{"type":32,"tag":63,"props":1471,"children":1472},{"style":76},[1473],{"type":37,"value":1474},") }}\n",{"type":32,"tag":63,"props":1476,"children":1477},{"class":65,"line":341},[1478,1483,1488,1492,1497,1502],{"type":32,"tag":63,"props":1479,"children":1480},{"style":70},[1481],{"type":37,"value":1482},"  WHERE",{"type":32,"tag":63,"props":1484,"children":1485},{"style":76},[1486],{"type":37,"value":1487}," cohort_date ",{"type":32,"tag":63,"props":1489,"children":1490},{"style":70},[1491],{"type":37,"value":1119},{"type":32,"tag":63,"props":1493,"children":1494},{"style":76},[1495],{"type":37,"value":1496}," CURRENT_DATE() ",{"type":32,"tag":63,"props":1498,"children":1499},{"style":70},[1500],{"type":37,"value":1501},"-",{"type":32,"tag":63,"props":1503,"children":1504},{"style":106},[1505],{"type":37,"value":1506}," 31\n",{"type":32,"tag":63,"props":1508,"children":1509},{"class":65,"line":403},[1510,1515,1520],{"type":32,"tag":63,"props":1511,"children":1512},{"style":76},[1513],{"type":37,"value":1514},"  {% ",{"type":32,"tag":63,"props":1516,"children":1517},{"style":70},[1518],{"type":37,"value":1519},"if",{"type":32,"tag":63,"props":1521,"children":1522},{"style":76},[1523],{"type":37,"value":1524}," is_incremental() %}\n",{"type":32,"tag":63,"props":1526,"children":1527},{"class":65,"line":447},[1528,1533,1537,1542,1547,1551,1556,1561,1565],{"type":32,"tag":63,"props":1529,"children":1530},{"style":70},[1531],{"type":37,"value":1532},"    AND",{"type":32,"tag":63,"props":1534,"children":1535},{"style":76},[1536],{"type":37,"value":1487},{"type":32,"tag":63,"props":1538,"children":1539},{"style":70},[1540],{"type":37,"value":1541},">",{"type":32,"tag":63,"props":1543,"children":1544},{"style":76},[1545],{"type":37,"value":1546}," (",{"type":32,"tag":63,"props":1548,"children":1549},{"style":70},[1550],{"type":37,"value":310},{"type":32,"tag":63,"props":1552,"children":1553},{"style":106},[1554],{"type":37,"value":1555}," MAX",{"type":32,"tag":63,"props":1557,"children":1558},{"style":76},[1559],{"type":37,"value":1560},"(cohort_date) ",{"type":32,"tag":63,"props":1562,"children":1563},{"style":70},[1564],{"type":37,"value":453},{"type":32,"tag":63,"props":1566,"children":1567},{"style":76},[1568],{"type":37,"value":1569}," {{ this }})\n",{"type":32,"tag":63,"props":1571,"children":1572},{"class":65,"line":461},[1573],{"type":32,"tag":63,"props":1574,"children":1575},{"style":76},[1576],{"type":37,"value":1577},"  {% endif %}\n",{"type":32,"tag":63,"props":1579,"children":1580},{"class":65,"line":485},[1581],{"type":32,"tag":63,"props":1582,"children":1583},{"style":76},[1584],{"type":37,"value":171},{"type":32,"tag":63,"props":1586,"children":1587},{"class":65,"line":506},[1588,1593,1597],{"type":32,"tag":63,"props":1589,"children":1590},{"style":76},[1591],{"type":37,"value":1592},"retention_calc ",{"type":32,"tag":63,"props":1594,"children":1595},{"style":70},[1596],{"type":37,"value":84},{"type":32,"tag":63,"props":1598,"children":1599},{"style":76},[1600],{"type":37,"value":89},{"type":32,"tag":63,"props":1602,"children":1604},{"class":65,"line":1603},19,[1605,1609],{"type":32,"tag":63,"props":1606,"children":1607},{"style":70},[1608],{"type":37,"value":98},{"type":32,"tag":63,"props":1610,"children":1611},{"style":76},[1612],{"type":37,"value":315},{"type":32,"tag":63,"props":1614,"children":1616},{"class":65,"line":1615},20,[1617,1622,1626,1630],{"type":32,"tag":63,"props":1618,"children":1619},{"style":106},[1620],{"type":37,"value":1621},"    c",{"type":32,"tag":63,"props":1623,"children":1624},{"style":76},[1625],{"type":37,"value":206},{"type":32,"tag":63,"props":1627,"children":1628},{"style":106},[1629],{"type":37,"value":333},{"type":32,"tag":63,"props":1631,"children":1632},{"style":76},[1633],{"type":37,"value":338},{"type":32,"tag":63,"props":1635,"children":1637},{"class":65,"line":1636},21,[1638,1643,1647,1651,1655,1659,1663,1667,1671,1675,1679,1683,1687,1691,1695],{"type":32,"tag":63,"props":1639,"children":1640},{"style":76},[1641],{"type":37,"value":1642},"    DATE_DIFF(",{"type":32,"tag":63,"props":1644,"children":1645},{"style":70},[1646],{"type":37,"value":119},{"type":32,"tag":63,"props":1648,"children":1649},{"style":76},[1650],{"type":37,"value":114},{"type":32,"tag":63,"props":1652,"children":1653},{"style":106},[1654],{"type":37,"value":229},{"type":32,"tag":63,"props":1656,"children":1657},{"style":76},[1658],{"type":37,"value":206},{"type":32,"tag":63,"props":1660,"children":1661},{"style":106},[1662],{"type":37,"value":238},{"type":32,"tag":63,"props":1664,"children":1665},{"style":76},[1666],{"type":37,"value":935},{"type":32,"tag":63,"props":1668,"children":1669},{"style":106},[1670],{"type":37,"value":940},{"type":32,"tag":63,"props":1672,"children":1673},{"style":76},[1674],{"type":37,"value":206},{"type":32,"tag":63,"props":1676,"children":1677},{"style":106},[1678],{"type":37,"value":333},{"type":32,"tag":63,"props":1680,"children":1681},{"style":76},[1682],{"type":37,"value":216},{"type":32,"tag":63,"props":1684,"children":1685},{"style":70},[1686],{"type":37,"value":387},{"type":32,"tag":63,"props":1688,"children":1689},{"style":76},[1690],{"type":37,"value":243},{"type":32,"tag":63,"props":1692,"children":1693},{"style":70},[1694],{"type":37,"value":84},{"type":32,"tag":63,"props":1696,"children":1697},{"style":76},[1698],{"type":37,"value":400},{"type":32,"tag":63,"props":1700,"children":1702},{"class":65,"line":1701},22,[1703,1708,1712,1716,1720,1724,1728,1732,1736],{"type":32,"tag":63,"props":1704,"children":1705},{"style":106},[1706],{"type":37,"value":1707},"    COUNT",{"type":32,"tag":63,"props":1709,"children":1710},{"style":76},[1711],{"type":37,"value":114},{"type":32,"tag":63,"props":1713,"children":1714},{"style":70},[1715],{"type":37,"value":418},{"type":32,"tag":63,"props":1717,"children":1718},{"style":106},[1719],{"type":37,"value":201},{"type":32,"tag":63,"props":1721,"children":1722},{"style":76},[1723],{"type":37,"value":206},{"type":32,"tag":63,"props":1725,"children":1726},{"style":106},[1727],{"type":37,"value":211},{"type":32,"tag":63,"props":1729,"children":1730},{"style":76},[1731],{"type":37,"value":243},{"type":32,"tag":63,"props":1733,"children":1734},{"style":70},[1735],{"type":37,"value":84},{"type":32,"tag":63,"props":1737,"children":1738},{"style":76},[1739],{"type":37,"value":1740}," retained_users,\n",{"type":32,"tag":63,"props":1742,"children":1744},{"class":65,"line":1743},23,[1745,1750,1754,1758,1762,1767,1771,1775],{"type":32,"tag":63,"props":1746,"children":1747},{"style":106},[1748],{"type":37,"value":1749},"    MAX",{"type":32,"tag":63,"props":1751,"children":1752},{"style":76},[1753],{"type":37,"value":114},{"type":32,"tag":63,"props":1755,"children":1756},{"style":106},[1757],{"type":37,"value":940},{"type":32,"tag":63,"props":1759,"children":1760},{"style":76},[1761],{"type":37,"value":206},{"type":32,"tag":63,"props":1763,"children":1764},{"style":106},[1765],{"type":37,"value":1766},"first_day_events",{"type":32,"tag":63,"props":1768,"children":1769},{"style":76},[1770],{"type":37,"value":243},{"type":32,"tag":63,"props":1772,"children":1773},{"style":70},[1774],{"type":37,"value":84},{"type":32,"tag":63,"props":1776,"children":1777},{"style":76},[1778],{"type":37,"value":1779}," cohort_size\n",{"type":32,"tag":63,"props":1781,"children":1783},{"class":65,"line":1782},24,[1784,1788,1792,1796],{"type":32,"tag":63,"props":1785,"children":1786},{"style":70},[1787],{"type":37,"value":142},{"type":32,"tag":63,"props":1789,"children":1790},{"style":76},[1791],{"type":37,"value":1464},{"type":32,"tag":63,"props":1793,"children":1794},{"style":145},[1795],{"type":37,"value":1469},{"type":32,"tag":63,"props":1797,"children":1798},{"style":76},[1799],{"type":37,"value":1800},") }} c\n",{"type":32,"tag":63,"props":1802,"children":1804},{"class":65,"line":1803},25,[1805,1810,1815,1820,1824,1829],{"type":32,"tag":63,"props":1806,"children":1807},{"style":70},[1808],{"type":37,"value":1809},"  JOIN",{"type":32,"tag":63,"props":1811,"children":1812},{"style":76},[1813],{"type":37,"value":1814}," {{ source(",{"type":32,"tag":63,"props":1816,"children":1817},{"style":145},[1818],{"type":37,"value":1819},"'raw'",{"type":32,"tag":63,"props":1821,"children":1822},{"style":76},[1823],{"type":37,"value":287},{"type":32,"tag":63,"props":1825,"children":1826},{"style":145},[1827],{"type":37,"value":1828},"'events'",{"type":32,"tag":63,"props":1830,"children":1831},{"style":76},[1832],{"type":37,"value":1833},") }} e \n",{"type":32,"tag":63,"props":1835,"children":1837},{"class":65,"line":1836},26,[1838,1843,1847,1851,1855,1859,1863,1867],{"type":32,"tag":63,"props":1839,"children":1840},{"style":70},[1841],{"type":37,"value":1842},"    ON",{"type":32,"tag":63,"props":1844,"children":1845},{"style":106},[1846],{"type":37,"value":1053},{"type":32,"tag":63,"props":1848,"children":1849},{"style":76},[1850],{"type":37,"value":206},{"type":32,"tag":63,"props":1852,"children":1853},{"style":106},[1854],{"type":37,"value":211},{"type":32,"tag":63,"props":1856,"children":1857},{"style":70},[1858],{"type":37,"value":1066},{"type":32,"tag":63,"props":1860,"children":1861},{"style":106},[1862],{"type":37,"value":201},{"type":32,"tag":63,"props":1864,"children":1865},{"style":76},[1866],{"type":37,"value":206},{"type":32,"tag":63,"props":1868,"children":1869},{"style":106},[1870],{"type":37,"value":1871},"user_id\n",{"type":32,"tag":63,"props":1873,"children":1875},{"class":65,"line":1874},27,[1876,1880,1884,1888,1892,1897,1901,1905,1909,1913],{"type":32,"tag":63,"props":1877,"children":1878},{"style":70},[1879],{"type":37,"value":1482},{"type":32,"tag":63,"props":1881,"children":1882},{"style":106},[1883],{"type":37,"value":1053},{"type":32,"tag":63,"props":1885,"children":1886},{"style":76},[1887],{"type":37,"value":206},{"type":32,"tag":63,"props":1889,"children":1890},{"style":106},[1891],{"type":37,"value":333},{"type":32,"tag":63,"props":1893,"children":1894},{"style":70},[1895],{"type":37,"value":1896}," IN",{"type":32,"tag":63,"props":1898,"children":1899},{"style":76},[1900],{"type":37,"value":1546},{"type":32,"tag":63,"props":1902,"children":1903},{"style":70},[1904],{"type":37,"value":310},{"type":32,"tag":63,"props":1906,"children":1907},{"style":76},[1908],{"type":37,"value":1487},{"type":32,"tag":63,"props":1910,"children":1911},{"style":70},[1912],{"type":37,"value":453},{"type":32,"tag":63,"props":1914,"children":1915},{"style":76},[1916],{"type":37,"value":1917}," cohorts_to_update)\n",{"type":32,"tag":63,"props":1919,"children":1921},{"class":65,"line":1920},28,[1922,1926,1930,1934,1938,1942,1946,1950,1954,1958,1962],{"type":32,"tag":63,"props":1923,"children":1924},{"style":70},[1925],{"type":37,"value":1532},{"type":32,"tag":63,"props":1927,"children":1928},{"style":70},[1929],{"type":37,"value":619},{"type":32,"tag":63,"props":1931,"children":1932},{"style":76},[1933],{"type":37,"value":114},{"type":32,"tag":63,"props":1935,"children":1936},{"style":106},[1937],{"type":37,"value":229},{"type":32,"tag":63,"props":1939,"children":1940},{"style":76},[1941],{"type":37,"value":206},{"type":32,"tag":63,"props":1943,"children":1944},{"style":106},[1945],{"type":37,"value":238},{"type":32,"tag":63,"props":1947,"children":1948},{"style":76},[1949],{"type":37,"value":243},{"type":32,"tag":63,"props":1951,"children":1952},{"style":70},[1953],{"type":37,"value":1119},{"type":32,"tag":63,"props":1955,"children":1956},{"style":106},[1957],{"type":37,"value":1053},{"type":32,"tag":63,"props":1959,"children":1960},{"style":76},[1961],{"type":37,"value":206},{"type":32,"tag":63,"props":1963,"children":1964},{"style":106},[1965],{"type":37,"value":1132},{"type":32,"tag":63,"props":1967,"children":1969},{"class":65,"line":1968},29,[1970,1974,1979,1983,1987,1991,1995,1999,2003,2007,2011,2015,2019,2023,2027,2032],{"type":32,"tag":63,"props":1971,"children":1972},{"style":70},[1973],{"type":37,"value":1532},{"type":32,"tag":63,"props":1975,"children":1976},{"style":76},[1977],{"type":37,"value":1978}," DATE_DIFF(",{"type":32,"tag":63,"props":1980,"children":1981},{"style":70},[1982],{"type":37,"value":119},{"type":32,"tag":63,"props":1984,"children":1985},{"style":76},[1986],{"type":37,"value":114},{"type":32,"tag":63,"props":1988,"children":1989},{"style":106},[1990],{"type":37,"value":229},{"type":32,"tag":63,"props":1992,"children":1993},{"style":76},[1994],{"type":37,"value":206},{"type":32,"tag":63,"props":1996,"children":1997},{"style":106},[1998],{"type":37,"value":238},{"type":32,"tag":63,"props":2000,"children":2001},{"style":76},[2002],{"type":37,"value":935},{"type":32,"tag":63,"props":2004,"children":2005},{"style":106},[2006],{"type":37,"value":940},{"type":32,"tag":63,"props":2008,"children":2009},{"style":76},[2010],{"type":37,"value":206},{"type":32,"tag":63,"props":2012,"children":2013},{"style":106},[2014],{"type":37,"value":333},{"type":32,"tag":63,"props":2016,"children":2017},{"style":76},[2018],{"type":37,"value":216},{"type":32,"tag":63,"props":2020,"children":2021},{"style":70},[2022],{"type":37,"value":387},{"type":32,"tag":63,"props":2024,"children":2025},{"style":76},[2026],{"type":37,"value":243},{"type":32,"tag":63,"props":2028,"children":2029},{"style":70},[2030],{"type":37,"value":2031},"\u003C=",{"type":32,"tag":63,"props":2033,"children":2034},{"style":106},[2035],{"type":37,"value":2036}," 30\n",{"type":32,"tag":63,"props":2038,"children":2040},{"class":65,"line":2039},30,[2041,2045,2049,2053],{"type":32,"tag":63,"props":2042,"children":2043},{"style":70},[2044],{"type":37,"value":157},{"type":32,"tag":63,"props":2046,"children":2047},{"style":106},[2048],{"type":37,"value":282},{"type":32,"tag":63,"props":2050,"children":2051},{"style":76},[2052],{"type":37,"value":287},{"type":32,"tag":63,"props":2054,"children":2055},{"style":106},[2056],{"type":37,"value":292},{"type":32,"tag":63,"props":2058,"children":2060},{"class":65,"line":2059},31,[2061],{"type":32,"tag":63,"props":2062,"children":2063},{"style":76},[2064],{"type":37,"value":301},{"type":32,"tag":63,"props":2066,"children":2068},{"class":65,"line":2067},32,[2069,2073],{"type":32,"tag":63,"props":2070,"children":2071},{"style":70},[2072],{"type":37,"value":310},{"type":32,"tag":63,"props":2074,"children":2075},{"style":76},[2076],{"type":37,"value":315},{"type":32,"tag":63,"props":2078,"children":2080},{"class":65,"line":2079},33,[2081],{"type":32,"tag":63,"props":2082,"children":2083},{"style":76},[2084],{"type":37,"value":2085},"  cohort_date,\n",{"type":32,"tag":63,"props":2087,"children":2089},{"class":65,"line":2088},34,[2090],{"type":32,"tag":63,"props":2091,"children":2092},{"style":76},[2093],{"type":37,"value":2094},"  day_n,\n",{"type":32,"tag":63,"props":2096,"children":2098},{"class":65,"line":2097},35,[2099],{"type":32,"tag":63,"props":2100,"children":2101},{"style":76},[2102],{"type":37,"value":2103},"  retained_users,\n",{"type":32,"tag":63,"props":2105,"children":2107},{"class":65,"line":2106},36,[2108],{"type":32,"tag":63,"props":2109,"children":2110},{"style":76},[2111],{"type":37,"value":2112},"  cohort_size,\n",{"type":32,"tag":63,"props":2114,"children":2116},{"class":65,"line":2115},37,[2117,2122,2126],{"type":32,"tag":63,"props":2118,"children":2119},{"style":76},[2120],{"type":37,"value":2121},"  SAFE_DIVIDE(retained_users, cohort_size) ",{"type":32,"tag":63,"props":2123,"children":2124},{"style":70},[2125],{"type":37,"value":84},{"type":32,"tag":63,"props":2127,"children":2128},{"style":76},[2129],{"type":37,"value":2130}," retention_rate\n",{"type":32,"tag":63,"props":2132,"children":2134},{"class":65,"line":2133},38,[2135,2139],{"type":32,"tag":63,"props":2136,"children":2137},{"style":70},[2138],{"type":37,"value":453},{"type":32,"tag":63,"props":2140,"children":2141},{"style":76},[2142],{"type":37,"value":2143}," retention_calc;\n",{"type":32,"tag":33,"props":2145,"children":2146},{},[2147,2149,2158],{"type":37,"value":2148},"Bu model her gün sadece son 31 günlük cohort'ları günceller. 31 günden eski cohort'larda retention sabittir — tekrar hesaplanmaz. Slot kullanımı %95 düşer. ",{"type":32,"tag":2150,"props":2151,"children":2155},"a",{"href":2152,"rel":2153},"https:\u002F\u002Fwww.roibase.com.tr\u002Ftr\u002Fretention-engineering-cdp",[2154],"nofollow",[2156],{"type":37,"value":2157},"CDP & Retention Engineering",{"type":37,"value":2159}," sürecinde bu tablo, dashboard'a doğrudan bağlanır — BI aracı (Looker, Metabase) üzerinde sorgu 100ms'de döner.",{"type":32,"tag":40,"props":2161,"children":2163},{"id":2162},"query-cost-ve-partition-expiration-stratejisi",[2164],{"type":37,"value":2165},"Query Cost ve Partition Expiration Stratejisi",{"type":32,"tag":33,"props":2167,"children":2168},{},[2169],{"type":37,"value":2170},"BigQuery'de storage ucuz ($0.02\u002FGB\u002Fmonth), compute pahalı ($5\u002FTB işlenen veri). Retention analizi retrospektif olduğu için eski partition'lar sık taranır. İki optimizasyon:",{"type":32,"tag":1213,"props":2172,"children":2173},{},[2174,2191],{"type":32,"tag":1217,"props":2175,"children":2176},{},[2177,2182,2184,2189],{"type":32,"tag":1249,"props":2178,"children":2179},{},[2180],{"type":37,"value":2181},"Partition expiration:",{"type":37,"value":2183}," ",{"type":32,"tag":59,"props":2185,"children":2187},{"className":2186},[],[2188],{"type":37,"value":541},{"type":37,"value":2190}," tablosunda 90 günden eski partition'ları otomatik sil — cohort hesaplaması tamamlandıktan sonra raw event'e ihtiyaç yok.",{"type":32,"tag":1217,"props":2192,"children":2193},{},[2194,2199,2200,2206],{"type":32,"tag":1249,"props":2195,"children":2196},{},[2197],{"type":37,"value":2198},"Clustering istatistiklerini periyodik olarak güncelle:",{"type":37,"value":2183},{"type":32,"tag":59,"props":2201,"children":2203},{"className":2202},[],[2204],{"type":37,"value":2205},"ANALYZE TABLE ... UPDATE STATISTICS",{"type":37,"value":2207}," — query optimizer daha iyi execution plan seçer.",{"type":32,"tag":33,"props":2209,"children":2210},{},[2211],{"type":37,"value":2212},"Örnek maliyet karşılaştırması (100M event\u002Fgün, 1M kullanıcı):",{"type":32,"tag":2214,"props":2215,"children":2216},"table",{},[2217,2241],{"type":32,"tag":2218,"props":2219,"children":2220},"thead",{},[2221],{"type":32,"tag":2222,"props":2223,"children":2224},"tr",{},[2225,2231,2236],{"type":32,"tag":2226,"props":2227,"children":2228},"th",{},[2229],{"type":37,"value":2230},"Yöntem",{"type":32,"tag":2226,"props":2232,"children":2233},{},[2234],{"type":37,"value":2235},"İşlenen veri\u002Fgün",{"type":32,"tag":2226,"props":2237,"children":2238},{},[2239],{"type":37,"value":2240},"Aylık compute maliyeti",{"type":32,"tag":2242,"props":2243,"children":2244},"tbody",{},[2245,2264,2282],{"type":32,"tag":2222,"props":2246,"children":2247},{},[2248,2254,2259],{"type":32,"tag":2249,"props":2250,"children":2251},"td",{},[2252],{"type":37,"value":2253},"Naif sorgu (full scan)",{"type":32,"tag":2249,"props":2255,"children":2256},{},[2257],{"type":37,"value":2258},"12TB",{"type":32,"tag":2249,"props":2260,"children":2261},{},[2262],{"type":37,"value":2263},"$600",{"type":32,"tag":2222,"props":2265,"children":2266},{},[2267,2272,2277],{"type":32,"tag":2249,"props":2268,"children":2269},{},[2270],{"type":37,"value":2271},"Partitioned + materialized view",{"type":32,"tag":2249,"props":2273,"children":2274},{},[2275],{"type":37,"value":2276},"800GB",{"type":32,"tag":2249,"props":2278,"children":2279},{},[2280],{"type":37,"value":2281},"$40",{"type":32,"tag":2222,"props":2283,"children":2284},{},[2285,2290,2295],{"type":32,"tag":2249,"props":2286,"children":2287},{},[2288],{"type":37,"value":2289},"Pre-aggregated tablo (incremental)",{"type":32,"tag":2249,"props":2291,"children":2292},{},[2293],{"type":37,"value":2294},"50GB",{"type":32,"tag":2249,"props":2296,"children":2297},{},[2298],{"type":37,"value":2299},"$2.5",{"type":32,"tag":33,"props":2301,"children":2302},{},[2303],{"type":37,"value":2304},"Pre-aggregate katmanı eklemek, compute maliyetini 240x düşürür. Bu fark production'da kritik — özellikle retention analizi her saat refresh ediliyorsa.",{"type":32,"tag":40,"props":2306,"children":2308},{"id":2307},"gerçek-zamanlı-cohort-analizi-tradeoffu",[2309],{"type":37,"value":2310},"Gerçek Zamanlı Cohort Analizi Tradeoff'u",{"type":32,"tag":33,"props":2312,"children":2313},{},[2314],{"type":37,"value":2315},"Materialized view ve pre-aggregate yapı, latency tradeoff'u getirir: veri 1-5 dakika gecikir. Eğer gerçek zamanlı cohort analizi gerekiyorsa (örn. ilk 24 saat için), hibrit yaklaşım uygulayabilirsiniz:",{"type":32,"tag":2317,"props":2318,"children":2319},"ul",{},[2320,2325],{"type":32,"tag":1217,"props":2321,"children":2322},{},[2323],{"type":37,"value":2324},"Son 24 saatlik veriler için streaming insert + real-time query (cache devre dışı)",{"type":32,"tag":1217,"props":2326,"children":2327},{},[2328],{"type":37,"value":2329},"24 saatten eski veriler için pre-aggregate tablo",{"type":32,"tag":33,"props":2331,"children":2332},{},[2333],{"type":37,"value":2334},"Bu durumda BI query'si iki kaynağı UNION ALL ile birleştirir:",{"type":32,"tag":52,"props":2336,"children":2338},{"className":54,"code":2337,"language":56,"meta":16,"style":16},"SELECT * FROM cohort_retention_summary WHERE cohort_date \u003C CURRENT_DATE()\nUNION ALL\nSELECT * FROM realtime_cohort_view WHERE cohort_date = CURRENT_DATE();\n",[2339],{"type":32,"tag":59,"props":2340,"children":2341},{"__ignoreMap":16},[2342,2380,2388],{"type":32,"tag":63,"props":2343,"children":2344},{"class":65,"line":66},[2345,2349,2353,2357,2362,2366,2370,2375],{"type":32,"tag":63,"props":2346,"children":2347},{"style":70},[2348],{"type":37,"value":310},{"type":32,"tag":63,"props":2350,"children":2351},{"style":70},[2352],{"type":37,"value":659},{"type":32,"tag":63,"props":2354,"children":2355},{"style":70},[2356],{"type":37,"value":664},{"type":32,"tag":63,"props":2358,"children":2359},{"style":76},[2360],{"type":37,"value":2361}," cohort_retention_summary ",{"type":32,"tag":63,"props":2363,"children":2364},{"style":70},[2365],{"type":37,"value":1140},{"type":32,"tag":63,"props":2367,"children":2368},{"style":76},[2369],{"type":37,"value":1487},{"type":32,"tag":63,"props":2371,"children":2372},{"style":70},[2373],{"type":37,"value":2374},"\u003C",{"type":32,"tag":63,"props":2376,"children":2377},{"style":76},[2378],{"type":37,"value":2379}," CURRENT_DATE()\n",{"type":32,"tag":63,"props":2381,"children":2382},{"class":65,"line":92},[2383],{"type":32,"tag":63,"props":2384,"children":2385},{"style":70},[2386],{"type":37,"value":2387},"UNION ALL\n",{"type":32,"tag":63,"props":2389,"children":2390},{"class":65,"line":136},[2391,2395,2399,2403,2408,2412,2416,2420],{"type":32,"tag":63,"props":2392,"children":2393},{"style":70},[2394],{"type":37,"value":310},{"type":32,"tag":63,"props":2396,"children":2397},{"style":70},[2398],{"type":37,"value":659},{"type":32,"tag":63,"props":2400,"children":2401},{"style":70},[2402],{"type":37,"value":664},{"type":32,"tag":63,"props":2404,"children":2405},{"style":76},[2406],{"type":37,"value":2407}," realtime_cohort_view ",{"type":32,"tag":63,"props":2409,"children":2410},{"style":70},[2411],{"type":37,"value":1140},{"type":32,"tag":63,"props":2413,"children":2414},{"style":76},[2415],{"type":37,"value":1487},{"type":32,"tag":63,"props":2417,"children":2418},{"style":70},[2419],{"type":37,"value":1296},{"type":32,"tag":63,"props":2421,"children":2422},{"style":76},[2423],{"type":37,"value":2424}," CURRENT_DATE();\n",{"type":32,"tag":33,"props":2426,"children":2427},{},[2428],{"type":37,"value":2429},"Real-time view maliyetli olsa da, sadece son cohort için çalıştığından toplam compute etkisi sınırlı kalır.",{"type":32,"tag":40,"props":2431,"children":2433},{"id":2432},"cohort-segmentasyonu-ve-kardinalite-patlaması",[2434],{"type":37,"value":2435},"Cohort Segmentasyonu ve Kardinalite Patlaması",{"type":32,"tag":33,"props":2437,"children":2438},{},[2439],{"type":37,"value":2440},"Retention analizini kullanıcı segmentlerine göre kırmak (platform, ülke, acquisition channel) kardinalite sorununu tetikleyebilir. Örneğin 5 segment × 30 gün × 365 cohort = 54.750 benzersiz satır. Bu durumda:",{"type":32,"tag":1213,"props":2442,"children":2443},{},[2444,2454,2464],{"type":32,"tag":1217,"props":2445,"children":2446},{},[2447,2452],{"type":32,"tag":1249,"props":2448,"children":2449},{},[2450],{"type":37,"value":2451},"Segment sayısını sınırlayın:",{"type":37,"value":2453}," En önemli 3-5 segment üzerinden analiz yapın, diğerleri için ayrı tablo oluşturun.",{"type":32,"tag":1217,"props":2455,"children":2456},{},[2457,2462],{"type":32,"tag":1249,"props":2458,"children":2459},{},[2460],{"type":37,"value":2461},"Dynamic segmentation:",{"type":37,"value":2463}," Pre-aggregate tablosuna segment bilgisi eklemek yerine, join-time filtering kullanın — bu query esnekliğini korur ama slot kullanımını artırır.",{"type":32,"tag":1217,"props":2465,"children":2466},{},[2467,2472],{"type":32,"tag":1249,"props":2468,"children":2469},{},[2470],{"type":37,"value":2471},"Rollup tablosu:",{"type":37,"value":2473}," Haftalık cohort'lar için ayrı tablo oluşturun (weekly_cohort_retention) — kardinalite %85 düşer.",{"type":32,"tag":33,"props":2475,"children":2476},{},[2477,2479,2486],{"type":37,"value":2478},"Roibase'in ",{"type":32,"tag":2150,"props":2480,"children":2483},{"href":2481,"rel":2482},"https:\u002F\u002Fwww.roibase.com.tr\u002Ftr\u002Fverianalizi",[2154],[2484],{"type":37,"value":2485},"Veri Analizi & İçgörü Mühendisliği",{"type":37,"value":2487}," sürecinde, segment stratejisini acquisition source attribution ile birleştiriyoruz — cohort analizi, kanal performansıyla doğrudan bağlantılanıyor.",{"type":32,"tag":40,"props":2489,"children":2491},{"id":2490},"monitoring-ve-regression-detection",[2492],{"type":37,"value":2493},"Monitoring ve Regression Detection",{"type":32,"tag":33,"props":2495,"children":2496},{},[2497],{"type":37,"value":2498},"Production'daki cohort pipeline'ı izlemek için şu metrikleri takip edin:",{"type":32,"tag":2317,"props":2500,"children":2501},{},[2502,2512,2522],{"type":32,"tag":1217,"props":2503,"children":2504},{},[2505,2510],{"type":32,"tag":1249,"props":2506,"children":2507},{},[2508],{"type":37,"value":2509},"Query slot time:",{"type":37,"value":2511}," Günlük refresh'in BigQuery slot kullanımı — ani artış, kardinalite patlaması veya partition pruning kaybı gösterir.",{"type":32,"tag":1217,"props":2513,"children":2514},{},[2515,2520],{"type":32,"tag":1249,"props":2516,"children":2517},{},[2518],{"type":37,"value":2519},"Row count delta:",{"type":37,"value":2521}," Her refresh'te eklenen satır sayısı — beklenenden fazla ise duplicate event riski var.",{"type":32,"tag":1217,"props":2523,"children":2524},{},[2525,2530],{"type":32,"tag":1249,"props":2526,"children":2527},{},[2528],{"type":37,"value":2529},"Retention rate stddev:",{"type":37,"value":2531}," Day 1 retention'da ani %10+ değişim, data quality sorunu sinyali.",{"type":32,"tag":33,"props":2533,"children":2534},{},[2535],{"type":37,"value":2536},"dbt içinde bu check'leri test olarak ekleyebilirsiniz:",{"type":32,"tag":52,"props":2538,"children":2542},{"className":2539,"code":2540,"language":2541,"meta":16,"style":16},"language-yaml shiki shiki-themes github-dark","tests:\n  - dbt_utils.expression_is_true:\n      expression: \"retention_rate BETWEEN 0 AND 1\"\n  - dbt_utils.recency:\n      datepart: day\n      field: cohort_date\n      interval: 1\n","yaml",[2543],{"type":32,"tag":59,"props":2544,"children":2545},{"__ignoreMap":16},[2546,2560,2577,2595,2611,2628,2644],{"type":32,"tag":63,"props":2547,"children":2548},{"class":65,"line":66},[2549,2555],{"type":32,"tag":63,"props":2550,"children":2552},{"style":2551},"--shiki-default:#85E89D",[2553],{"type":37,"value":2554},"tests",{"type":32,"tag":63,"props":2556,"children":2557},{"style":76},[2558],{"type":37,"value":2559},":\n",{"type":32,"tag":63,"props":2561,"children":2562},{"class":65,"line":92},[2563,2568,2573],{"type":32,"tag":63,"props":2564,"children":2565},{"style":76},[2566],{"type":37,"value":2567},"  - ",{"type":32,"tag":63,"props":2569,"children":2570},{"style":2551},[2571],{"type":37,"value":2572},"dbt_utils.expression_is_true",{"type":32,"tag":63,"props":2574,"children":2575},{"style":76},[2576],{"type":37,"value":2559},{"type":32,"tag":63,"props":2578,"children":2579},{"class":65,"line":136},[2580,2585,2590],{"type":32,"tag":63,"props":2581,"children":2582},{"style":2551},[2583],{"type":37,"value":2584},"      expression",{"type":32,"tag":63,"props":2586,"children":2587},{"style":76},[2588],{"type":37,"value":2589},": ",{"type":32,"tag":63,"props":2591,"children":2592},{"style":145},[2593],{"type":37,"value":2594},"\"retention_rate BETWEEN 0 AND 1\"\n",{"type":32,"tag":63,"props":2596,"children":2597},{"class":65,"line":151},[2598,2602,2607],{"type":32,"tag":63,"props":2599,"children":2600},{"style":76},[2601],{"type":37,"value":2567},{"type":32,"tag":63,"props":2603,"children":2604},{"style":2551},[2605],{"type":37,"value":2606},"dbt_utils.recency",{"type":32,"tag":63,"props":2608,"children":2609},{"style":76},[2610],{"type":37,"value":2559},{"type":32,"tag":63,"props":2612,"children":2613},{"class":65,"line":165},[2614,2619,2623],{"type":32,"tag":63,"props":2615,"children":2616},{"style":2551},[2617],{"type":37,"value":2618},"      datepart",{"type":32,"tag":63,"props":2620,"children":2621},{"style":76},[2622],{"type":37,"value":2589},{"type":32,"tag":63,"props":2624,"children":2625},{"style":145},[2626],{"type":37,"value":2627},"day\n",{"type":32,"tag":63,"props":2629,"children":2630},{"class":65,"line":174},[2631,2636,2640],{"type":32,"tag":63,"props":2632,"children":2633},{"style":2551},[2634],{"type":37,"value":2635},"      field",{"type":32,"tag":63,"props":2637,"children":2638},{"style":76},[2639],{"type":37,"value":2589},{"type":32,"tag":63,"props":2641,"children":2642},{"style":145},[2643],{"type":37,"value":1132},{"type":32,"tag":63,"props":2645,"children":2646},{"class":65,"line":191},[2647,2652,2656],{"type":32,"tag":63,"props":2648,"children":2649},{"style":2551},[2650],{"type":37,"value":2651},"      interval",{"type":32,"tag":63,"props":2653,"children":2654},{"style":76},[2655],{"type":37,"value":2589},{"type":32,"tag":63,"props":2657,"children":2658},{"style":106},[2659],{"type":37,"value":2660},"1\n",{"type":32,"tag":33,"props":2662,"children":2663},{},[2664],{"type":37,"value":2665},"Test fail olursa Slack\u002FPagerDuty alert'i tetiklenir — manuel kontrol beklenmez.",{"type":32,"tag":33,"props":2667,"children":2668},{},[2669],{"type":37,"value":2670},"Cohort tablo mimarisi, retention analizini \"ad-hoc sorgu\" seviyesinden \"production data product\" seviyesine taşır. Materialized view ile incremental refresh, partitioning ile query pruning, pre-aggregate ile slot optimizasyonu — her katman maliyeti 10x düşürür. Milyonlarca kullanıcı ve milyarlarca event üzerinde retention analizi yapmak artık 100ms'lik dashboard query'sine indirgenir. Hangi retention pattern'ini izlemeniz gerektiğine karar vermek hâlâ sizin işiniz — ama veriyi bu hızda işlemek artık mühendislik sorunu değil.",{"type":32,"tag":2672,"props":2673,"children":2674},"style",{},[2675],{"type":37,"value":2676},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":16,"searchDepth":136,"depth":136,"links":2678},[2679,2680,2681,2682,2683,2684,2685,2686],{"id":42,"depth":92,"text":45},{"id":546,"depth":92,"text":549},{"id":677,"depth":92,"text":680},{"id":1203,"depth":92,"text":1206},{"id":2162,"depth":92,"text":2165},{"id":2307,"depth":92,"text":2310},{"id":2432,"depth":92,"text":2435},{"id":2490,"depth":92,"text":2493},"markdown","content:tr:data:cohort-tablo-mimarisi-retention-analizinin-productionda-olceklenmesi.md","content","tr\u002Fdata\u002Fcohort-tablo-mimarisi-retention-analizinin-productionda-olceklenmesi.md","tr\u002Fdata\u002Fcohort-tablo-mimarisi-retention-analizinin-productionda-olceklenmesi","md",1780898609875]