Sysop Dev Diary, Part 4: More Backend Dev
So I took the day off yesterday, and some of this morning to do some Christmas shopping, but I'm back on it now. Small thought in the intervening time. I'm worried about the eventual size and performance of the Message table. It'll be working real hard, real fast, if this thing sees almost any use at all. With a Postgres database behind it, I'll probably get several millions of entries before it becomes a problem I can't just throw more hardware at, but something to be aware of for the future.
Moving on. Last place I left this was being able to create messages between users via an api call. I think the next step is to start laying out the process of creating those users.
I need to keep reminding myself. This is a prototype, a proof of concept. It doesn't need to be robust. It doesn't need to even be correct, all the way anyway. If the app works, if people like the idea, I can refine it. Right now, I need to be in Get It Done mode. I might need to write that a few more times before this is over, because I'm optimizing this database in my head right now and I do not need to be doing that.
Okay. Update the User model to contain a one-to-many reference to any Messages it has and rename it to EndUser to avoid confusion. Update Message and simplify. Company and EndUser, and a bool flag to decide if it was sent by the user or not. Company model is just an id and a name for now. Update the migrations and rebuild everything.
I'll need a separate admin tool for creating Company entries. No big deal to do that manually for now. In the meantime, I'll fill out the CRUD routes for EndUser and Message.