Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

4

A problem occurs when I need to manually modify the non-maintained data in the development version. Then don't. Instead, create an SQL script which does. Reapply that script at an appropriate time during deployment of the next release of your application. Is there a recommended form of version control for the non-maintained tables Well, I cannot tell ...


0

Why do you have both tables in the same database? I'd expect to see one table in each of Development and Production, with each holding the values relevant to that environment. Having both in the same database at the same time is just asking for trouble, say, when you accidentally change the wrong one! Because there are two separate tables, I need to ...


1

This might be a good use case for an EAV table. Here are your columns: ID int PK PlayerID int ItemID int Value string (or whatever) EAV's are typically used for sparse matrices, exactly what you describe in your question.


2

It's very unlikely that you could restrict the access to a single table in a real application, so you would have to specify all the required tables and maintain that list. It's a somewhat normal approach to limit things to the database user on the larger scale, such as using different roles for reporting, normal users, admins etc. depending on which layers ...


1

Although SOA does not have a unanimously accepted definition, I would like to quote Udi Dahan here, see original article. Mr. Dahan also has a great definition for a service: A service is the technical authority of a business capability. Elaborating on that definition, since a service should be the authority of a business capability, it should own its ...


1

From the example what you seem to want to do is get all the users who have commented on any post in a particular thread. Generally if you find yourself doing complex queries to try and get a specific set of data that is a sign that what you actually need is just a new resource Something like GET /threads/{threadUuid}/all_users_that_commented and let the ...


0

It is a common pattern to combine multiple service behind a facade, especially if the link between your client and server would be a bottle neck (especially if it could be a mobile device). It might be worth checking out GraphQL before you completely re-invent the wheel yourself: https://graphql.org/


3

As @1201ProgramAlarm commented, you have to consider DST for precision since the offset changes along the year. And from year to year since the saving time change doesn't occur every year on the same days. Take Madrid's time zone and its DST for 2019. If the user specifies the offset UTC+2, we have to consider the possibility to allow the user to specify ...


0

Expanding table with offset column seems to be a good idea. There is no point in searching for optimizations as far as it works good enough.


3

One of the possible ways to solve this dilemma is to think of SQL as of an assembly language: you rarely, if at all, code directly in it, but where performance matters, you need to be able to understand the code produced by your C/C++/Golang/Rust compiler and maybe even write a tiny snippet in assembly, if you cannot change the code in you high level ...


1

The UserItems table doesn't need an HasAccess field. If a record exists in this table for a combination of UserId and ItemId, it means the user has access to the item. If you want to revoke access, delete the record. So I would definately advise against this: When a new user gets added they should automatically get assigned all of the items (...


0

I think your model could be better. As it is it allows a section to be related to many node_sections rather than to maximum of 2. You could either: write a digit 2 on the diagram to show that there is a maximum cardinality at that end of the relationship; or drop node_section and have two 1:m relationships directly between node and section. If your pipe ...


Top 50 recent answers are included