Friday 15 August 2014

design - Separation of concerns in Node.js app and dealing with load across different processes -


I have a node application that keeps data from a MongoDB database in the hands of most of this data, such as < Although the data for the code> user collection, this app also has the concept of the website collection, and for this collection, the data should be downloaded somewhere before saving.

I am thinking how should I separate the above concerns in my application at the service level, I have things like user and website . They provide basic CRUD operation, on the opposite end of the spectrum, there is a user interface through which a website can input the URL. To keep data between this UI and the application in the MongoDibi (service layer), the application must make a request to this URL to collect some data. After receiving the data, the website service continues it.

Potentially, these URLs can be entered at once, and the node process that controls the web server due to the problem I load below. So I think it would be a good idea to summarize the work for a separate process and will use some kind of messaging to tie the app together.

It seems that you have decomposed the system correctly - and it is firmly "service" On the layer, I have made a separate system, by moving forward a separate distribution system architecture (i.e. SOA / Micro-Service)

The initial step of creating a distributed system is to complete the overall business goal of the application Come to mapping for doing and ending points of service Shyk to identify each function. Each loose coupled service termination point will then serve a small separation job / event and it will act as an abstract for that business goal.

By separating all responsibilities to terminate service, you create small independent limitations for scalability, throughput, fault tolerance, security, deployment, etc. For example - for example - this could mean that both users (such as / users / {userid} ) and websites (like / Websites / {websiteid | url} ) ... and possibly an additional resource for maintaining links / links between two (e.g. / users / {userid} / userwebsites: {websiteid: 1234, url: blah.com ).

This separation means that you can handle website processing responsibilities independently, which will have many benefits - just to handle different load characteristics. -

No comments:

Post a Comment