Tag Info

Hot answers tagged

61

What came first, the process, or the data used by that process? I know this is kind of a "chicken or the egg" question, but in the case of software, I believe it is the process. For instance, you can build up your data model incrementally by implementing a single use-case at a time with just in-memory persistence (or anything as easy to implement). When you ...


12

A root cause analysis suggests this problem is not one of method, but is the lack of a specification. Without one it doesn't really matter what you write first - you are going to throw it away anyway. Do yourself a favour and do some basic systems analysis - identify some users at various levels, make up a quick & dirty questionnaire then turn off your ...


12

Let's talk positives and negatives of the microservice approach. First negatives. When you create microservices, you're adding inherent complexity in your code. You're adding overhead. You're making it harder to replicate the environment (eg for developers). You're making debugging intermittent problems harder. Let me illustrate a real downside. ...


8

I was going to say Database First since I have a lot of experience with large projects and you really need a solid data model if you have many developers working in parallel. But then I though about it a little more and I realized that what we were really doing on the more successful large projects was "requirements first". A good well specified set of ...


7

Since this seems so fluid/unspecified, I'd do the frontend GUI first - that sounds like what you need to get responses, support, time, and feedback from the stakeholders, right? They don't care about your brilliant normalized tables and foreign keys constraints and cascading deletes. But a cool GUI with lots of shiny colors - well, that's top notch! For ...


6

Actually, I would not change the whole type of database system because there is one minor problem with modeling one artifact. Assumed you will stick to a relational DB system, you have the following options: live with multiple tables for each type of information about persons. Yes, some queries may become a little bit more complicated, but to my ...


4

My experience is as follows: In most projects I've worked on, we design the database first. Often times data already exist in spreadsheets, legacy databases, paper, etc. That data will hint you about the tables you need to hole it. Often times a process is already being use, yet manually or using several, disparate tools that are not automated, don't ...


3

You might use three total tables (adjust table/column names and SQL dialect to taste). The first is the user table, which contains the master list of user_id's. The second is the folder table, that will contain a list of folders for users. | folders | |------------------| | id (int) | | user_id (int) | | name (varchar) | And a ...


3

It seems you raised the question with the answer already: From my point of view, the solution I would have tried is: "... Add a new table, which tracks number of seats over time. Tuple: (HallID, numberOfSeats, validFrom, validUntil) ..." This way, you are also able to track when the number of seats was changed. Also in the code you are able to know the ...


2

You don't strictly want to know the total number of seats, but the total number of seats available to be sold. For example, some seats may be in existence physically but unsellable for a given event. I'd be inclined to think about an "available seat" as a tuple of (hallId, seatId, eventId) - which you can pair up with a Reservation when it arrives. Given ...


2

Follow composition over inheritance as composition lends itself well to relational databases. Say you want to get all short messages: SELECT * FROM Message INNER JOIN ShortMessage ON ShortMessage.message = Message.id Say you want to get all short messages and emails: SELECT * FROM Message LEFT OUTER JOIN ShortMessage ON ShortMessage.message = ...


2

First about storing file paths: Having several image path columns (imagepath1, imagepath2 ... imagepathN ) violates 1NF. Storing several comma-separated image paths in the same column also violates 1NF. When you violate the simplest of normal forms, you will have a lot of headaches in the future. The correct thing to do is create a separate table for ...


2

Here is my favorite approach: Each table has a corresponding history table Write stored procedures (or triggers) to make sure that all actions are logged to the history tables On insert, add a row to the history table with start = now() and end = 31.12.2999 On update, first update the most recent history record to end = now(). Then insert a new row with ...


2

My experience in this sort of thing is to prefer to stay consistent within my program. In other words, you feel you can't do without a database, then your program would likely be more robust if it depended only on that database rather than also on the file system. The more components your program depends on, the more problematic it becomes in terms of ...


1

Some (much?) data, such as the book example, isn't inherently hierarchical. That the bookstore example uses hierarchical storage is a consequence of XML's tree structure, not the inherent structure of the data. Consider that a book can have many authors, and an author can write many books, which means neither can strictly belong to the other. XML gets around ...


1

Hierarchical databases used to be very popular, but they went out of fashion in the 80s because they are not very good at supporting ad hoc querying, and setting them up could be difficult, I believe. The best known standard for hierarchical databases was the CODASYL data model (see http://en.m.wikipedia.org/wiki/CODASYL for details of this), which was ...


1

If you choose to maintain a hierarchy in a relational database, you need to look into the Nested Set design pattern. (See Wikipedia) This model involves some programming, and it involves some overhead at insert or update time. The benefit comes at retrieval time. Retrieving the path or the subtree for any given node is easy and fast, when compared to the ...


1

The question can be reworded as "I have the canonical perfect application for a nosql key-value store, what should I do?". Yes, this can be done with sql, but a nosql implementation is likely to be more efficient. Look at systems like riak, apache cassandra, berkeley db or memcachedb, or if you're planning on deploying to amazon web services dynamodb. Or ...


1

I wholeheartedly agree with btilly's answer, but just wanted to add another positive for Microservices, that I think is an original inspiration behind it. In a Microservices world, services are aligned to domains, and are managed by separate teams (one team may manage multiple services). This means that each team can release services entirely separately and ...


1

Door number (2) is attractive if you can do it. The problem with many applications tracking long-lived facilities (theater halls and other building components, aircraft, cargo vessels, ...) is that they assume those assets are invariant. They are not. As relatively inflexible and expensive capital assets, they are not changed very often--but they definitely ...


1

What you really need is an additional "address type" column containing values like "home", "work", "summer home", "winter home" etc. and have several "address" rows per person. You will need something like this to decide which address is the most useful for a given use case.



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