0

I need to create a .net core web application (or some kind of .net core service) which do web scraping from various web sites, and writes result to database.

Then I need to create another .net core web app in which I will do some actions with data from the FIRST app. However I should be able to update database by starting FIRST application from SECOND app by clicking button.

What is the best way to do this? 1) I need to use .net core. 2) I need that it be two apps, because I should be able to use FIRST application somewhere else, for example in THIRD application. 3) Do I need to create some kind of .net core service. Or do separate apps, and then some how link them?

3
  • 2
    Sounds like your "first" application should probably be an API really (as opposed to an MVC app with a GUI), then you can make a simple HTTP request to it to trigger whatever actions you want, or request data from it. But if this "scraping" takes a long time, as it might, then perhaps you want to actually offload that job to a longer-running task or separate Service, and not run it all within the context of a HTTP request. This kind of architecture discussion is generally considered a bit broad (and potentially opinion-based) for SO, though. Commented Mar 27, 2018 at 15:34
  • And if I request "first" app from "Second" app to do something, I will be able to use "Second" app while "first" doing its job? Commented Mar 27, 2018 at 16:12
  • 1
    @Dov95 that is called an asynchronous task, for that you might need to check Task or Thread concepts/examples Commented Mar 27, 2018 at 16:15

1 Answer 1

1

The questions is quite broad but goes my broad answer too ;-)

  1. Write a .Net Core service that has two main methods: scrapData and getData, the the scrapData puts data into the Database after the scrapping takes place

  2. Second app references and uses the service you created on step 1 and calls the getData method to obtain the scrapped data

Step 1 could also be a WebApi with a exposed method that you call from any other app when needed. This depends on your arquitecture limitations (but consier @ADyson comments regardin this option)

For more reference visit these sites

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.