HI All Currently we have a web service in the Our Platform, that is called from the database.
When something changes inside the database, it should by itself initiate and inform an External Application.
The application should NOT be polling the database and enquiring of the change.
The current solution which we have is a HTTP call but this has it's own overhead. Also, it does not guarantee 100% message delivery.
So is there an alternate solution.
Can the database write to a Queue?
Related
I am looking for the best way to call web api hourly to retrieve data from SQL server. I have the asp.net web API but not sure which approach/technology I should use to run it hourly. Any suggestion/piece of code or technological idea would be great help.
Use either a Windows Service or a Console App that's executed via a scheduled task.
Of course, this would only make sense if the machine your hoping to initiate the calls from doesn't already have access to your database. If it does, consider just making the database call directly. If you can't make the database call directly, just be sure you can reach your Web API via port 80 or 443.
I'm working on a web application and I'm having problem accessing the database on server side because there is no user for the DB proxy to map. In other word, I have a method which will start as soon as the application comes online and will call itself every 5 seconds to check for new messages. If it receives a specified message, it then goes to the database and finds whatever it needs. However, accessing database on server side wouldn't be possible because there is no user for the DB proxy to map. So what is a good design pattern for this type of application? Should I need an application account for these type of automation process?
Btw, I'm using Weblogic JPA 2.1 for database stuff.
Thanks in advance.
First of all, what exactly do you mean by "no user for the DB proxy to map"?
I assume, you meant that you don't have a user known by a session who connects to the database?
If yes, you usually wouldn't do that anyway and instead nearly always have a database user for your application. Then, no matter a user triggers a database call by an action or the backend triggers it by some scheduling, it will always be the same user who does it. In your Java EE application, you'd have a datasource containing this user in its configuration and all your application parts use the related entity manager when doing persistent actions or queries.
I am building a real time web application with angular js, express js and passport js.
The passport authentication is working fine on the main server. I have written a second logging server also in express js and want to use this to simply receive http POST requests from an angular js service. This will enable client side exceptions/errors to be recorded and available for debugging purposes etc. I don't want to introduce a dependency on logging in the main server so to have this logically separated.
I am thinking about introducing a redis store for passport/express sessions so that the logging server is also subject to authentication and sessions can be shared across the two servers. I am not sure how to implement this session sharing though.
In this scenario what is the best practice is for authenticating across the two servers - I don't want the user to have to log in twice.
You nailed it down. redis store yes. There's no need for manual implementation. Have both servers use same instance of redis server (i.e. cloud redis, installed locally on only one machine etc). express sessions have the ability to use redis store (take a look at connect-redis package). Sharing is accomplished automatically since both stacks will communicate with same redis store.
The way it works in details, when the user is auth the connect.sid cookie gets written to the browser. then subsequent requests (i.e. to second server) will transmit this cookie. second server sees the SID and looks it up and finds it and retrieves the same session from redis.
It's hands off implementation.
Could someone please explain to me in a simple way, what is a web service?
Please correct me if I'm wrong. I have a DB hosted somewhere in the web, and I want to perform DB transactions from a desktop application as well as a mobile application. Can this be done through a web service ? Someone mentioned it to me and I wanted to make sure this could happen.
Here's a good explanation on Wikipedia.
A middle dynamic content processing and generation level application server, for example Ruby on Rails, Java EE, ASP.NET, PHP, ColdFusion platform
The middle tier of a 3-tier application is often the web service
i want to perform DB transactions from a desktop application and a mobile application, can this be done through a web service ?
This is Exactly what a web service is for.
A web service allow you to create multiple front ends if needed, and serve your database data to all of those front ends. You can also open up the API and allow third party developers to access the web service and thereby access the data of your application in a controlled environment.
It's considered a better practice for larger applications to access a web service or a middle tier rather than directly access the database.
In your case, a web service would involve setting up your DB behind a web server that listens for incoming requests, performs the appropriate DB operations, and returns whatever data is appropriate. Then, your desktop and mobile applications could send a http request and the DB would respond appropriately. This would let all your applications access the same DB.
My newest task is going to be to implement automatic update of a licence:
The program detects that the licence is expired or about to expire and offers the user to automatically upate this. So far so good. Now what is needed:
The program sends the user's credentials to a win 2008 server over the internet.
The server checks the credentials and if they are OK generates a licence file that is sent back.
How to implement these steps if I cannot use .Net technology?
What not instead of transferring a file, think of it like invoking a web service (or web page) on the server and that returning the content of the license file?
In the VB application you then receive the page response and save that to a local file.
This alternative is used in LicenseSpot for online activation. You can check the API documentation for a general idea.