New answers tagged

0

As you mention in the comments, one solution is to remove the foreign keys. You would need to make sure that all your queries join back to the root user table to ensure the permissions are no longer found from the other tables. IMO this is a little ugly. Foreign keys can help with avoiding data problems. There's also a chance that eliminating the foreign ...


2

It is very advisable to have everything in a deterministic state for running tests. One way to achieve this is to clean up the DB before running tests, like Arseni already suggested. Another usefull approach is to create the DB just for the test and drop it afterwards. For many DBMS there are libraries that provide a programmatic interface to setup and ...


3

You need to do it before every test, obviously, in order for the test not to be affected by other tests. On the other hand, keep the data in the database after the test in order to make it easier to debug a test, especially the one which fails.


2

There is nothing wrong in having tables with no relationships. The choice of a database in order to store those settings is perfectly fine and quite common. The only issue you might encounter is performance, but basic caching at server level would quickly solve this. A usual problem is what types of columns should you use for such table if you're relying ...


1

HTTP is an application protocol; it's application domain is the transfer of documents over a network. The HTTP specification describes the semantics of the request messages and responses that are used by participants in that protocol. So a REST API is a facade - we're taking some service that knows how to perform useful work, and disguising it as an HTTP ...


2

I agree with Greg Burghardt but I would come at it from a different angle. Ideally your PUT POST operations should be validating the data written to them. Writing empty data in a PUT/POST is a very likely bug. Verifying that there is data in the request and/or matches a defined structure is a way to prevent a lot of data corruption issues. If you use an ...


2

Given that a delete, or even overwriting something to make it "empty" is a destructive operation, I would definitely not want an endpoint I use to update something to also destroy something. As somebody using this resource, I would expect a delete to permanently remove something. I would also not expect an endpoint that updates a resource to essentially ...


1

Any algorithm that requires you to compare each set to every other set is doomed to failure. It's an O(n2) problem. The classic way around this is either minhash + LSH, or, if you only wish to detect near-identical sets of titles, simhash. Both approaches reduce it down to an O(n.log(n)) problem. Both are statistically based: they are not guaranteed to ...


2

Welcome, not quite the questions I think will be accepted here, but never the less; my 2 cents follows. Maybe look at influxdb, I have some success working with them. For prototyping, I don't think you should work with anything more then what you already do, as you don't need to optimize queries at this stage, you have a ux/ui to build. If your project ...


0

It would be better to use composite primary key as it will be combined together so that the combination is unique. It will allow you to set multiple unique columns as a constraint.


1

You need three tables: an Events table, a Guests table, and a linking table having GuestID and EventID. Otherwise, a given guest will only ever be able to attend one event. Don't spread an entity over multiple tables. Always prefer adding an additional column that distinguishes groups of entities, but make it a single table.


1

An 'ERD' (Entity-Relationship Diagram) is a type of diagram -- i.e. a standard way of drawing/modelling an information structure by specifying entities and their relationships. An ERD can be used to model a real/physical database, or to illustrate a logical or conceptual view of an information structure. A physical model is a schema for a relational ...


Top 50 recent answers are included