zthomas
TTCTheo's Typesafe Cult
•Created by Ayato on 4/10/2023 in #questions
Which icon set would you recommend?
2 replies
TTCTheo's Typesafe Cult
•Created by code_sanchu on 3/30/2023 in #questions
Keep order of a list of items in prisma
but yes, you would re-order the array whenever an item is added/moved/deleted. and it would use far fewer writes
10 replies
TTCTheo's Typesafe Cult
•Created by code_sanchu on 3/30/2023 in #questions
Keep order of a list of items in prisma
it depends on the requirements of the application but I would imagine a model for Album and AlbumCollection with a many-to-many relationship. the AlbumCollection would have a JSON field with an array of indexes. this way an album could be part of many collections and each collection could maintain a unique order. If an album for whatever reason is removed from the db it doesn't matter so much that it's index is orphaned in the JSON array.
10 replies
TTCTheo's Typesafe Cult
•Created by code_sanchu on 3/30/2023 in #questions
Keep order of a list of items in prisma
Could you just make a model for your list and store the order in json as an array of indexes?
10 replies
TTCTheo's Typesafe Cult
•Created by zthomas on 3/8/2023 in #questions
data pipeline for custom user analytics dashboards
Thanks for the reply!
As far as event volume a daily event summary for an individual user might have at most a few thousand events.
I do not need realtime updates and I think as often as once a day would be fine.
Mixpanel api queries are limited to 60 queries per hour so I would more or less be raw exporting events and parsing them myself, since I have many more users that I could accommodate with some kind of scheduled query queue.
I suspect I would just be dumping a daily raw export, parsing events and creating a summary for each user, and writing these summaries to the database.
I'd like to avoid dumping every analytics event into my primary database and would be fine with just storing summaries that could be queried quickly and updated periodically (hourly or daily).
Explo looks like a nice product but I don't think I can justify their price point and have no issues building the front-end myself.
The downside of this approach as you mentioned is that I'm redoing the work of generating reports that mixpanel is already capable of. While we use mixpanel for our own internal reports and it's not painfully expensive, it's not ideal that I can't leverage their query engine to solve this particular problem. If I used a data warehouse to allow for the opportunity to have more granular reporting it would feel like paying for the same service twice. This project doesn't need to scale to millions of users so I'm trying to not over-engineer
6 replies
TTCTheo's Typesafe Cult
•Created by Tom on 2/1/2023 in #questions
Slow cold start times in Vercel with my T3 App API
my personal solution has been to pull out any heavy lambda workflows into a seperate project using Serverless which handles code splitting and allows defining layers for your lambdas.
16 replies
TTCTheo's Typesafe Cult
•Created by Tom on 2/1/2023 in #questions
Slow cold start times in Vercel with my T3 App API
this is my assumption as well, but very painful for anyone building apis with heavier functions. it seems that any heavy library in your api folder, or even your front-end layout gets dumped into this shared bundle for api routes and impacts cold starts
16 replies
TTCTheo's Typesafe Cult
•Created by Tom on 2/1/2023 in #questions
Slow cold start times in Vercel with my T3 App API
I also tested it with a clean next app and the same is true. code imported in _app.tsx increased the function size of the example api route. I'd be curious if someone with deeper knowledge of next has any insight into this, and if the increased function size due to layout code has any meaningful impact on cold start times
16 replies
TTCTheo's Typesafe Cult
•Created by Tom on 2/1/2023 in #questions
Slow cold start times in Vercel with my T3 App API
I was curious about this and deployed a fresh t3 app to vercel. The size of the serverless function for api/trpc/[trpc] at this point is 10.38 MB, which I assume is largely prisma. However, after installing and loading a few packages in _app.tsx and redploying, the size of the serverless function increased.
Does this mean that code in our layouts is increasing the size of our api routes?
16 replies