First, apologies in advance if this is in the wrong place - I wasn't sure if it should be here or in Code Review, but as I'm not actually asking for anyone to review my code . . .
Here's my project: Mostly as a learning exercise I am writing my own blog engine. Here's how it works:
Admin writes post - > post is saved to .html file, and details of post are written BOTH to a MySQL database and a JSON file using PHP - > posts are loaded onto site via iframes, determined by JavaScript using the details in the JSON file.
Thus for loading posts onto the site, no PHP or access to the database is required. The only reason for the database at all is to have an editable record so that if the admin needs to delete a post, the entry can be removed from the database and the JSON file re-written from the database.
What I want to know: 1) This seems a bit cumbersome. Would people recommend doing away with the JSON and making more use of the database? How do I integrate this with JavaScript stuff? 2) Is storing each post as a separate .html file and loading as an iframe a reasonable way of doing things? 3) Is there any way to cut out the PHP entirely? I am not keen on it really. I am starting to learn Python, but it seems an awful palaver for a small blog engine.
As you can probably tell, I am VERY new to programming! I have looked into TaffyDB, which in theory could get rid of the database entirely - I load the JSON with Taffy, remove one record, and re-write the JSON . . . except I'd still need PHP to write to file I think? Also, I am worried that relying entirely on JSON files will make things very slow (I understand speed issues increase exponentially with JSON size?)
Any advice/feedback would be welcome, and again I apologise if I'm posting in the wrong bit of StackExchange.