is it possible to have fun programming (25)

12 Name: Anonymous Techie : 2021-11-21 15:41 ID:Heaven

You use php, huh. You can't handle binary data in php well, so flatfile approach is probably out of the question there. In C or C++ it is relatively simple though, you allocate a large enough chunk of memory, and store everything there: posts, images, image thumbnails, arrays, vectors, structures. Writing a website in C is a bit scary though, simply because how easy it is to make a mistake that leaves your code open to all kinds of attacks. But if you do write it well, it will be very fast. Golang kind of aims to be good in the webdev area, that's a direction to consider.

The issue with having too many small files is filesystem fragmentation, on spinning media drives needle needs to move all over the place to seek for the next file, unless everything is stored in one file.

You could make "file database" more resistant to errors by having 2 files, and you take turns writing to database1.bin and database2.bin. It's better to keep post database and actual images separate, simply because all your posts may end up as heavy as a single jpg image.

I wonder where you can host your site you wrote in C. Besides your own computer, of course. I think facebook is written in C++, just like all the biggest sites are. I'd be happy to host something because I'm jobless anyway and have shitton of time, but I don't want my ip to get involved in anything, and I don't want to pay.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: