Skip to content

Conversation

Mkassabov
Copy link
Collaborator

No description provided.

@sam-goodwin
Copy link
Collaborator

There are a lot of unrelated changes in this PR

@Mkassabov Mkassabov changed the base branch from main to mkassabov/telemetry-v2 September 30, 2025 18:00
Copy link

pkg-pr-new bot commented Sep 30, 2025

Open in StackBlitz

npm i https://pkg.pr.new/alchemy-run/alchemy@1031

commit: 7eb96f9


## Why we left posthog

Alchemy used to use posthog for our platform analytics. While posthot was really easy to set up (see our example here) it simply didn't meet our needs. One of our most important metrics is the number of projects that use alchemy. In order to get quality analytics from posthog we would need to give each alchemy project a dedicated project id and maintain that id as a project grows; this proves to be quite a challenging issue. We can't just use a UUID and store it somewhere as alchemy doesn't have a config file, and we don't expect the `.alchemy` directory to be committed. We explored using various other solutions such as the root commit hash (unavailable for partial clone) or the git upstream url (breaks if origin changes) but none of these solutions were reliably enough. Ultimately we decided to identify projects based on multiple factors instead of having a single id.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a new line break at "this proves to be quite a challenging issue."?


Between not having a consistent project id, and multiple of our team members having experience with datalakes and large scale analytics solutions, we decided to switch to a more developer-oriented solutions. Just having all of our own data in-house so we can do whatever we want with it as we please.

That being said posthog is great at what it does, and we will continue to use posthog for our web analytics where its still a great fit!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jacob pointed out we should do the whole "compliment sandwhich thing" since we want to make it clear posthog isn't bad

Comment on lines +13 to +22
We started with a few criteria
- we wanted an OLAP database since they are great for analytics
- we wanted something SQL based so we didn't have to learn a new query language
- we wanted something to avoid the big cloud providers as we don't support GCP or Azure yet, and we are in the middle of revamping our AWS resources as part of our [effect](https://effect.website/) based rewrite.
- we wanted something quick as the team was getting frustrated with our current analytics solution.
- preferrably a nice controlplane api

After looking at the options we decided to go with Clickhouse Cloud. It had a great controlplane api so making a resource was easy. First we generate a typescript api from Clickhouse's OpenAPI spec, then we write our alchemy resource.

This is a simplified example, but we're omitting clickhouse's plethora of customization options for brevity, but the full resource is available [here](https://github.com/alchemy-framework/alchemy/blob/main/alchemy/src/clickhouse/service.ts).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try and avoid bullet point lists. Tell the story. I don't think we've told the story of needing a compound key.

Comment on lines +24 to +32
```ts
export const Service = Resource(
"clickhouse::Service",
async function (
this: Context<Service>,
id: string,
props: ServiceProps,
): Promise<Service> {
const api = createClickhouseApi();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Way too much code. Why is this useful for the blog?

@sam-goodwin
Copy link
Collaborator

Blog started off great but then lost its narrative form. Let's try and convert it into narrative structure.

Base automatically changed from mkassabov/telemetry-v2 to main October 1, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants