63 votes

What is the best practice about microservice architecture for consuming many stored procedures in the same database?

I get the feeling that some decision maker in your company heard about the buzzword "micro-service" and decided that you need to have them as well, regardless of if they actually solve a ...
user avatar
15 votes
Accepted

I can't really tell the difference between Hexagonal and Layered Architecture

The key difference is about dependency management: Layered architectures are intended to reduce dependencies by stacking layers: every component in one layer may depend on components of the layer ...
user avatar
  • 67.8k
14 votes

I can't really tell the difference between Hexagonal and Layered Architecture

It can be confusing, with Layered Architecture being such generic term. Nowadays, anything is layered architecture. Difference is what each layer does and how they depend on each other. (Legacy) ...
user avatar
  • 35.5k
12 votes

Instability metric vs Dependency Injection

DI just makes dependencies explicit and configurable at run time, but it does not change the number and kind of dependencies - at least not directly. For example, when a class delegates persistence to ...
user avatar
  • 185k
11 votes
Accepted

Alternative to using enum

Creating a single-column table in a DB just for team names would be overkill IMO. Create a proper Teams table then. With a key and Name and maybe some other properties that a team may have. This can ...
user avatar
  • 2,894
11 votes

Boneheaded exceptions should not be caught. Then how to provide fault tolerance and reliability?

Fail as early as possible, and catch in context. Going by the definition on https://ericlippert.com/2008/09/10/vexing-exceptions/, a boneheaded exception isn't one that should not be caught, it's in ...
user avatar
  • 600
8 votes

Multi tenant architecture, single database?

Multi-tenant systems seem more complicated to develop, but are vastly easier to manage and are much more flexible. In principle, it is easy to have multiple “databases”. More precisely, it is easy to ...
user avatar
  • 124k
7 votes

Storing scraping functions code inside a database

Although storing code in the database can work and can be made safe, I would seriously consider alternatives which allow you to put the code under source code control. Maybe changing your architecture ...
user avatar
6 votes
Accepted

Are common design patterns applicable for microservice architectures?

The classic “Gang of Four” design patterns are about solving recurring code-level problems through object-oriented techniques. These remain relevant within a microservice, though of course some ...
user avatar
  • 124k
6 votes

Debug statements in production quality code?

Conditional compilation is commonly used for debugging statement. You will therefore find these #ifdef DEBUG of NDEBUG blocks in production quality code. Because the same code that was not ...
user avatar
  • 67.8k
6 votes

Boneheaded exceptions should not be caught. Then how to provide fault tolerance and reliability?

Your examples are both in the area of interfaces to systems that are not under your control, which is different from the interfaces between components that you control and where you can ensure that ...
user avatar
6 votes

How to refactor a lot of Functions that can be run in two different modes

If the value of run_type can be determined before these are called then classes may be a good solution. Currently it looks like you call the code this way: read_text( clean_path( path_join(path, ...
user avatar
6 votes

Microservices that needs to change row in shared DB

Am i really left with only option - make app A expose rest API and call the endpoint from app B and C to update the row in DB? If you're doing microservices properly, yes. Don't forget to version the ...
user avatar
  • 9,257
5 votes

Archival-quality future-proof pseudo-CPU architecture

The problem is that you're replacing a relatively simple problem with a harder one. We already have a number of well documented file formats. These cover documents, still images, sounds and video. ...
user avatar
  • 8,704
5 votes

How to solve an issue when a decorator needs variables from the base class?

First and foremost, the Decorator has nothing to do with inheritance. If you are extending a class, that is bog standard polymorphism. A Decorator has the same interface as the class you are trying ...
user avatar
5 votes
Accepted

Why is the 4+1 architecture model view named "4+1"?

The 4+1 approach to software architecture has 4 different but complementary views on the systems internals. The 5th view (+1) differs from the others, as it’s about the system’s externals: the uses ...
user avatar
  • 67.8k
5 votes

Class Constructor that Takes Two Arguments of the Same Interface - But Order Matters

You register LessSpecificMap with your DI, you register MoreSpecificMap with your DI and then you write LookupService so that it has a constructor taking (MoreSpecificMap moreSpecificMap, ...
user avatar
  • 6,947
5 votes

QR order - how to prevent customers from placing an order when they're not on premise

A QR code is just a machine-readable representation of some string (in your case, an URL). Strings can be copied and kept using whatever mechanisms, you can't seriously protect against that. The ...
user avatar
5 votes
Accepted

Best pattern/practice to execute a multi-step code generation process

There is nothing inherently wrong in having an orchestator doing these steps one after another. When all you need is this fixed step of sequences, don't start to throw some fancy patterns at the code ...
user avatar
  • 185k
4 votes

How to handle db query between two or more microservices with different databases?

It's often difficult to talk about hypothetical situations and talk about them being problematic without hard numbers. There are so many different factors to consider here. Mainly, we don't have any ...
user avatar
  • 22.1k
4 votes

Storing scraping functions code inside a database

Storing the scrapping function is totally fine as long as those functions are managed by the dev team, not from an end-user. However, it is hard to debug those functions, test them and track changes. ...
user avatar
  • 653
4 votes
Accepted

How can users be notified of changes during collaborative editing in a system like Google Docs?

To solve the question of how Google Docs works: Here is a Blog post by the guy who designed the syncing system of gdocs: https://neil.fraser.name/writing/sync/ The link point to a detailed writeup of ...
user avatar
  • 102
4 votes

Boneheaded exceptions should not be caught. Then how to provide fault tolerance and reliability?

"Fail fast" is a good default, but fault tolerance may be worth it in some cases. You just have to be really careful how you do it, because an unexpected exception means some of the program ...
user avatar
  • 54.7k
4 votes

SQL Foreign Key Relationships and External Data

There are indeed plenty of ways to deal with this situation. And there are different solutions to address different concerns: Concern 1: maintain the relationships Just manage in your system the ...
user avatar
  • 67.8k
4 votes
Accepted

Application settings in relational database

I read recently in DB normalisation that, one column must have one value. This design then violates normalisation. Did I understand that correct? To the letter of the law, yes. Normalisation dictates ...
user avatar
  • 37.5k
4 votes
Accepted

Should micro services follow HTTP verbs precisely?

Should micro services follow HTTP verbs precisely? Yes. how big of an issue is it? That will depend on a number of things, including how many different organizations are communicating with your ...
user avatar
4 votes

Sharing an enum between a C++ and C# solution

I entered this answer expecting to be strongly disapproving of this approach, but I'm surprised to say that this is not the worst approach, in the right context. The problem with your question is that ...
user avatar
  • 37.5k
4 votes

Streaming Market Data Over The Public Internet

Your architecture should be driven by requirements. The basic idea that you will e.g. shovel updates down a socket, is not the architecture. Latency - how fast do you have to get updates to the ...
user avatar
  • 844
4 votes

I can't really tell the difference between Hexagonal and Layered Architecture

Remember that software is built from code, not diagrams. Certainly both architectural views have been employed in working software, so it is not that one isn't useable, just that the maintainability ...
user avatar
4 votes
Accepted

Is it okay for development infrastructure to depend on/communicate with staging infrastructure?

Having local development environments communicate with a staging service (or in some cases even a production service) is not fundamentally flawed. There are situations where this is perfectly fine. ...
user avatar
  • 22.8k

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