Tag Info

Hot answers tagged

10

I know it is better to use NoSQL for such requirements I'm not sure why you'd think that. After all, question data is very relational in nature. Here's what I'd do: User table UserId (primary key) UserName ... etc ... Following table (join table) FollowingUserId (foreign key to UserTable.UserId) FollowedUserId (foreign key to UserTable.UserId) ...


7

Your arguments in favor table-per-user are wrong: Every user is isolated This kind of isolation only makes sense if you create a DB user for each user and let them directly run SQL queries on your database. You usually don't do that, but instead create an API for pre-defined queries. That API should do the isolation, not some separation of ...


4

get rid of the document-based DB, its a horrible system for the kind of query you'll be doing. Go back to boring old RDBMS and you'll be a lot happier. If you do this, you can not only make reservations individually (which also help when someone adds a service to their reservation) but you can query all services assigned with a single reservation id. Simply ...


3

It is a matter of opinion. You might use postfix representation (à la RPN, or even some stack-oriented programming language), or some bytecode (specific to your expression language), or some s-expr syntax, if you want some more compact representation. JSON is probably a less compact textual representation but it is very widely used (and you've got many ...


2

You can't design your database that way, but you can write your queries (or rather, design your application) to handle that. The example with the LIMIT simply cannot be handled on the database because you can't change what LIMIT does fundamentally. Your example seems weird because a limit bascially means 'give me only X results'. What do you want to do if ...


2

$this->$data['id'] = $db->insertANewProduct($data); I think is a bad practice, because breaks de Single Responsibility Principle, the product class knows it's been persisted. You are loosing what you win with the repository pattern. If you want to do that another option (less OO) is Active Record. I would choose the option 1 public function ...


2

Pretty much what every other dev would do Because it's the right thing to do. what if i have 100.000 transactions With proper indexing, that's not a lot. MariaDB would have to do much more work Databases are not spreadsheets. They do not hold the entire table in memory and scan sequentially through it [often]. Most of your 100.000 ...



Only top voted, non community-wiki answers of a minimum length are eligible