{"id":24087981,"url":"https://github.com/tinybirdco/thinking-in-tinybird","last_synced_at":"2026-02-05T16:32:30.840Z","repository":{"id":40698085,"uuid":"495293596","full_name":"tinybirdco/thinking-in-tinybird","owner":"tinybirdco","description":"Data project to illustrate how to iterate when building new use cases in tinybird","archived":false,"fork":false,"pushed_at":"2022-06-26T11:40:54.000Z","size":38,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-27T05:25:23.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinybirdco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-23T07:00:01.000Z","updated_at":"2023-05-24T03:11:06.000Z","dependencies_parsed_at":"2022-08-19T04:11:50.860Z","dependency_job_id":null,"html_url":"https://github.com/tinybirdco/thinking-in-tinybird","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tinybirdco/thinking-in-tinybird","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fthinking-in-tinybird","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fthinking-in-tinybird/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fthinking-in-tinybird/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fthinking-in-tinybird/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinybirdco","download_url":"https://codeload.github.com/tinybirdco/thinking-in-tinybird/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fthinking-in-tinybird/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264540040,"owners_count":23624718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-10T03:56:52.657Z","updated_at":"2026-02-05T16:32:30.812Z","avatar_url":"https://github.com/tinybirdco.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# thinking-in-tinybird\nData project to illustrate how to iterate when building new use cases in tinybird.\n\n## Work backwards\n\nOur way of approaching new use cases in tinybird is as follows: \n\nThink of the output and adapt the pipes and schema accordingly. \n\nRather than applying directly the data model and building the logic based on that,\n ```\n\n*data |-------|      |-------|   api\n  ----\u003e| model |-----\u003e| logic |----\u003e\n       |-------|      |-------|\n ```\n redesign your logic and model based on expected output.\n ```\ndata  |-------|      |-------|   api*\n  ----\u003e| model |\u003c-----| logic |\u003c----\n       |-------|      |-------|\n ```\n\n\n\nIn practice, this means:\n\n## Work with some existing data sources or upload samples of new ones\n\nIf the use case you’re trying to build is a completely new one, you may need to create new data sources. The easiest way to do so is usually via the UI appending a sample\n\n## Define the expected output\n\nOnce you have a clear understanding of what you need to return and what parameters you're going to define you're ready to move to the next step.\n\n## Based on your datasources, start building your pipes. \n\nDon't think of MVs yet, just your datasources and the rules you learned [here](https://www.tinybird.co/guide/best-practices-faster-sql-queries)\n\n\u003e you can see a result of the first three steps in the `fist-draft` [branch](https://github.com/tinybirdco/thinking-in-tinybird/tree/first-draft) of this repo.\n\n## Refactor your data sources\n\nBased on the queries you will do and focused on reducing the amount of scanned data, edit your data source column types and indexes.\n\n\u003e you can check more details about all things to take into account in the `refactor-datasources` [branch](https://github.com/tinybirdco/thinking-in-tinybird/tree/refactor-datasources) of this repo.\n\n[Sneak peek](https://ui.us-east.tinybird.co/snapshot/b59d6076f9a747f5898a7916c3ce1767) of the improvements\n\n## Extra tips\n\nThe join of our pipe is OK because the companies data source only has 5 rows, but for JOINs with larger data sources, using subqueries reduce a lot the memory footprint. See this [example](https://ui.tinybird.co/snapshot/10e0ab7dcb8e4925bc63a3d46a0eebc2) taken from the Typeform [blogpost](https://www.tinybird.co/blog-posts/typeform-utm-realtime-analytics).\n\nSometimes your pipes constantly run an aggregtion that scans many rows, or you need several steps to transform the data model into something useful. If that's the case, check [materialized views](https://www.tinybird.co/guide/materialized-views), a feature that let's you transform data at ingestion time and incrementally refresh the view.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fthinking-in-tinybird","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinybirdco%2Fthinking-in-tinybird","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fthinking-in-tinybird/lists"}