I'm designing a database for a primary health center, the idea

We basically have a Patient with many Encounters, also the Encounters have to be entered from different Users (Health Professionals). Patient info is unlikely to change, the Encounter is the "important" part of this database, already persisted data it's not going to be modified, as we only have to insert new encounters as the patient comes to their controls. Users info it's also (very) unlikely to change. It could be possible that we are going to need to add more columns once a year in case the Health Ministry decides we need to start "logging" something else.

Right now, the "Encounters paper" (tarjetón) is basically a table with around 20 columns, where each row is a new Encounter.

This is a small center, so I'm not going to be dealing with lots of data, concurrency won't be an issue either, since only a couple of professionals are going to "write" to the database.

I started building using mongodb (rails app, using mongoid)

closed as primarily opinion-based by Paul White, Mikael Eriksson, Mark Storey-Smith, Max Vernon, RolandoMySQLDBA Jul 14 '14 at 13:49

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.


As usual in similar cases, I would strongly recommend that you look at Open Source solutions - well before the design phase. EVEN if you are doing something truly radical, one can always learn by standing on the shoulders of giants.

I have worked as a student on the OpenEHR project, so this interests me. It's been a while, but I would start by looking here, here and here. GIYF :-).

For a pure database recommendation, I would include the big three of Open Source databases - MySQL, PostgreSQL or Firebird. Find a system you wish to adapt. "Good programmers know what to write. Great ones know what to rewrite (and reuse)" and use the database with that - unless you have a particular requirement that precludes the chosen system's database.

There was a time I would not have recommended MySQL, but I have recently had occasion to work with it, and I was pleasantly surprised - though not having CHECK constraints is still a bit of a shock!

I note with interest in your profile that you are an experienced contributor to the stackexchange lists, so I would ask the question as to why you are choosing MongoDB? I'm not saying your choice is incorrect, I'm just wondering what it is that MongoDB has that you can't get from a "classic" RDBMS?

My understanding is that NoSQL solutions are meant to be for coping with web-scale problems (in big data and real-time web applications), and not running simple medical centres. Even if your system was dealing with the entire population of Chile, it still wouldn't start to be "large" on the web-scale. A further point would be that I can see no valid reason whatsoever to sacrifice consistency with medical data - it might be OK for books on Amazon, but not this sort of information ("Many NoSQL stores compromise consistency" [ibid]).

In any case, I wish you well with the project.

  • Thanks for taking the time for answering. I have looked at open source alternatives. The one that seems the best is OpenMRS, but I'm scared in picking it since I don't know Java at all, and where (or how) to deploy the application. Since this is going to be (likely) an one man army job, I rather go with a system I know more (like Rails). It's true about using nosql, I don't really have any compelling reason, I thought I had because of flexible schemas and embedding data, but quickly found I don't use them. – Pablo Olmos de Aguilera C. Jul 13 '14 at 16:41
  • I wasn't suggesting necessarily that you implement an off-the-shelf Open Source system - I was more getting at the idea that you should look at other designs and schemas before setting off on your own. Nothing wrong with doing your own simple system if it covers your own needs - and if you don't know Java, well, then just take the bits you like from OpenMRS and implement them in Rails. As for your database, it's not a big system so whatever you choose (even SQLite) would probably do the job. I was just slightly "critiquing" the automatic choice of a NoSQL db - classic RDBMSs are v. good too! – Vérace Jul 13 '14 at 17:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.