Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One database trick I used was to pre-select queries in the background and cache the results. It creates some code overhead for updating/inserting that has to keep the cache in sync. However, it simplified the logic in the rest of the code because I didn't need a promise for a select, I just read the cached object. That allows me to outsource the controllers for screens to developers who don't have to work with promise overload. They access my wrapper service for the content using synchronized code.

My database is also very simple. If you have a complicated schema with lots of joins, it'll be tough to cache things and keep it in sync with the db.

Feel free to email me, if you want more details on this concept.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: