5

It's not that queues are more scalable, its the fact that two services communicating through queue means the communication is asynchronous. Asynchronous communication is far more scalable than synchronous communication, as it allows the writer (who enqueues messages into the queue) and the consumers (who dequeues the messages) to progress in their own rhythm....


5

It depends whether you are expecting the network to go as fast as it can, or whether you're expecting to wait most of the time. If you are downloading a large file as fast as your network can handle it, you might not gain anything from parallel downloads, because downloading 2 files at once will just make each one half as fast. Note that the "switching ...


4

Nothing in the book tells you how to build this. You can write projects that follow this but a lot is left up to you. Both construction and input are missing here. So we're left making it up. So my first question is how does the controller handle different inputs from the user ?. If the call for the financial report comes from the web view then the ...


4

SRP is a code design principle which helps keep code easy to understand, decoupled, and reusable. This is mostly for code organization in object oriented programming. Outbox pattern is a technique for solving the problem: what if this transaction succeeds, then the event we have to send for that transaction fails? This is an architectural technique for ...


4

How should I share the functions of the target language that can be invoked by the shared library? Most languages/ecosystems have packages, and a system which manages those packages and the dependencies between them: pip for Python, npm for JavaScript, NuGet for C#, RubyGems for Ruby, etc. You create your wrapper as a package, and you rely on it from every ...


3

My question is who should be concerned with not overloading ServiceB? Should ServiceA trust that ServiceB will have some appropriate rate-limiting and be able to deal with a surge of requests? Or should ServiceA implement some limit on its end in terms of how many requests it makes at one time to ServiceB? Blind reliance is never a good thing. If you only ...


3

With a small number of concurrent workflows you won’t notice the difference. But imagine that you scale up to the trillions of workflows per day: Let’s take a workflow involving 10 microservices, and take 100 000 workflows per seconds. That’s 10 x 100 000 = 1 000 000 service requests that your orchestrator will have to coordinate. That’s as many requests ...


3

A game of chess is fully described by the list of moves that have taken place and the rules of the game. (8x8 board, starting positions etc) If you want to program it in a OOP style your objects are not Piece, Board etc they are things like Turn, Move, Game, NotiationParser, BoardDrawer and the like When learning OOP all the examples focus on real world ...


3

I think like most so-called principles (at least those originating broadly from proponents of OO and Agile), they are essentially empty tautologies which exist primarily to make it look like the author is communicating something useful. It's like saying "God is good", scarce any of the faithful can disagree, but it begs the very question of what is ...


3

We're considering further partitioning these parts into their own distinct source control repositories and having the CI system assemble the output project automatically. The suggestion is this: I would stick with a single repository in this case because it sounds like these separate repos must stay in sync with each other. Pros to splitting them up is ...


2

Code is abstraction, and abstraction is, well, an abstract concept. It's all about how you reason about the problem domain and how you break down the problem into its constituent parts and how these parts interact with one another. Functional and object-oriented approaches are very different, and both comes with their own benefits and drawbacks, but they are ...


2

Sometimes porting procedural code into oo is as easy as renaming things. For example ClockService. You just rename it to Clock and it works. It is a thing, it is business-relevant, etc. I would also rename the method isBetween9And10OClock() for the same reasons. You could assign a business-relevant name, like isHappyHour(), or isAdminOnlyHour(). Something ...


2

You already have an API. Spring is the API. While Spring does talk directly to the database, it does so through a Data Access Layer, and it separately exposes JSON endpoints for your application. A properly architected Spring API does not allow the public-facing endpoints to interface directly with the database. What you're labelling as an API in your second ...


2

You are sort-of right, however networking should not be done with a thread/connection. It doesn't scale and it's not the optimum design. Most all languages with I/O have a non-blocking variant of networking. This does not allocate a thread/connection, rather only uses a thread from a pool from every incoming/outgoing packet. This means you are notified when ...


2

"If the call for the financial report comes from the web view then the parameters received by the Financial Report Controller (for example date) are probably in JSON format. If it comes from a print instruction on a CLI application then it could be plain text." You don't pass in either of these to the interactor. Note the Financial Report Request ...


2

First, is this view of the separation of my classes really how others structure their code? Yes, unfortunately. Second, is it legitimate for one Service to instance and leverage a second Service? Services are just bags of procedures. They have no state, nor any abstraction capabilities. They are basically a flat list of procedures that operate on some ...


2

It depends on how you structure your code: if you mix up the code for "updating the domain model" and inserting a record into the "outbox" table (together with the enclosing transactional code) in a way it cannot be used, reused, and tested separately, then this code would violate the SRP if, however, you put the code for "updating ...


2

Since the question is too broad, my answer might sound too simplistic or naive. Or why not, too broad too. Excuse me in advance if the answer doesn't meet your expectations but I honestly think that it might help you out to find a starting point. I think, what you are striving to conceptualize is something that most of the REST API out there don't have. An ...


2

You wrote shared domain logic is a core library with code common to all projects and it already exists as an isolated piece of code Ask yourself, how much isolation does this lib have: does it have its own life cycle, apart from the projects / programs / layers using it? is it developed, tested, versioned and deployed completely on its own, and the other ...


2

Of course you can have the pieces holding the necessary logic. The only problem you have, as you mentioned, is that you need all the information about the board and positions too. There's a couple of possible options how to deal with that: You can pass all that information into the piece when necessary. For example on each invocation. of move or similar. ...


1

Service A should rate limit its outgoing calls to service B. Not doing so enables propagation of a cascade failure between the two services. Under normal steady state operations where there is sufficient provision of capacity in both service A and service B, then everyone is happy, and there is nothing to worry about. However, when a failure occurs. e.g. a ...


1

My question is who should be concerned with not overloading ServiceB? Should ServiceA trust that ServiceB will have some appropriate rate-limiting and be able to deal with a surge of requests? Or should ServiceA implement some limit on its end in terms of how many requests it makes at one time to ServiceB? For example, make 3 requests to ServiceB, only once ...


1

If so, what would be the best way to handle this situation ? Should I just call it using whatever HTTP Verb I want ? How would you do this with web pages? There would probably be an HTML page with a link on it, where the link would say something like "to do everything at once, fill in this form". The link brings you to the form, which would have ...


1

Since refactoring MyObject to use composition, the downstream impact on clients of MyObject is twofold: There is no impact. The refactoring was doing internal to MyObject. Clients of MyObject can and should continue calling the methods they used to call. This is the important first step, because this reduces how many files need to be changed. At this point ...


1

The controller is in charge of handling the user input and commands. In the original MVC there was one controller for many views and generally for one model (if needed there could be several models). Considering the architecture of modern windowing systems, the easiest way to implement this is to use approach 3 with a controller component per view, but also ...


1

With fewer components, the final solution is simpler and more resources can be deployed on machine performance. Secondary Data - I like to model such data as primary and secondary data: Primary: Post with location Secondary: Active posts in zone The primary data is a point of data with all of the details. The secondary data is basically a materialized ...


1

Some message processing frameworks (e.g. Celery) already include tools for background task management that allow task joining, chaining and whatnot. Otherwise, it should not be too hard to implement or extend (e.g. ASP). Your solution seems adequate for given use case, implementing something more advanced would be an overkill. But if you ever find yourself ...


1

In short This design hides a tight coupling between the classes in the hierarchy, which will make it difficult to evolve. It's difficult to analyse if benefits could outweight this major inconvenience in your special case. But in general, I'd advise another more flexible approach. Some more details If the context (e.g. a client class) uses a path such as : ...


1

we expect numerous small file conversion requests per minute (say 10), and also numerous scheduled file conversion requests (100/day) I wouldn't call 10/min or 100/day numerous by any stretch of the imagination. The scheduled file conversions must finish within an hour. Given you said it can take up to 10 min to generate a file, at worst you can do 6 ...


1

Load Testing You build the solution with the smallest/cheapest hardware you can and you work hard to ensure that it runs correctly on small hardware. When you think you have something ready for production, you begin Load Testing. To do that, you generate artificial user interactions and you monitor how your system behaves. If it works, you increase the ...


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