Enable an asp.net core web application to work without internet and with internet? - sql-server

I have been developing an asp.net core web application and published on the production mode (online server), the users can access it with the specific domain name and will log in and do data entry from three different countries.
But, the problem is sometimes, in one specific country there is no internet access, my client wants that this application should work online and offline, If there is no internet access the local branch must be able to do data entry, then when the internet gets connected data should send to the online server database,
What is the best way to achieve this goal?
Please write your view or add some good forum link below.

Rationally, it is not possible for you to access a Web App without internet. Web Apps are meant for network usage. However, I believe there is a workaround for such requirements. What you can do is that you can create a clone of your database for the third user, who has no internet access and perform all transactions within the local machine and when the connection comes back on line, you can replicate the data from the local SQL Server into the online server database.
And then there is something called Progressive Web Apps , which will allow you below privileges :
Reliable - Load instantly and never show the downasaur, even in uncertain network conditions.
Fast - Respond quickly to user interactions with silky smooth animations and no janky
Engaging - Feel like a natural app on the device, with an immersive user experience.
What are Progressive Web Applications, Google has something more to discuss here

Related

Is it best practice to connect directly to an aws db instance in an app

I am new to web development, and have seen posts such as these . If one is using AWS and is connecting to an AWS rds instance through Node, is that still considered a direct connection as opposed to a web service?
You're probably going to get a bunch of conflicting opinions on this. My personal opinion is a web service in front of your database makes sense in some scenarios. Multiple applications connecting to the web service instead of directly to the db gives several advantages, security, caching, etc.
That being said, if this is just a single app then most of those advantages disappear and in fact just make things more complex for you. You're going to have to setup your web service for the db as well as your actual code.
If one is using AWS and is connecting to an AWS rds instance through Node, is that still considered a direct connection as opposed to a web service?
No, if Node.js is running on a server or in "serverless" containers (e.g. AWS Lambda) that is not a direct connection. That is a web service, and that's what you want.
A direct connection means the app connects to the database itself... but that requires embedding credentials in the app.
You do not want to embed anything in your app that you would not willingly hand over to an arbitrary user -- such as database credentials and API keys -- because you cannot trust that the app won't be reverse-engineered.
You should design the app in such a way that you would have no security concerns if the entire source code of the app were exposed, because knowing everything about the app's internals would give a malicious actor no valuable information. How? The code on the server side (e.g. in Node.js) should treat every request from the app as potentially suspicious, untrustworthy, etc., and validates every request to do anything.
This layer of separation is one of the strongest reasons why you never give the app direct access to the database. Code running in a trusted place -- your web server/API layer -- needs to vet every database interaction. This topology also decouples the app user from tying up resources on the database server when not actually interacting with the database, which is far less practical with a direct connection.

Salesforce: is it possible to develop a web application on top of Salesforce

Let me start with a bit of background: I'm helping a non-profit organization that would like to have a browser-based application that is backed by Salesforce, but has very specific requirements.
I see Salesforce has a REST API that we can call, so we can develop a standalone application to serve the web pages they want and use the REST API to call Salesforce when needed.
I'm wondering if there is a way to host a web application directly on Salesforce; this way we don't have to have a separate application server. Any recommendations or pointers to documentation/open source products is greatly appreciated.
Yes, you can create services that will allow your app to hit Salesforce
Depending on the type of application, yes you can host it on salesforce using the Salesforce Sites feature, also you can develop and host your app on Heroku which is owned by salesforce and can sync data to and from salesforce using Heroku Connect, or you can build and host it on another service like AWS and connect via the REST API. You just need to investigate and choose the option that best fits your use-case. One thing to be aware of is that there are API limits (the number of calls you can make to salesforce in a rolling 24hr period). Depending the the needs of the app be sure to see if those limits will be an issue. Because if the app makes constant calls to salesforce that could be an issue. But there are things you can do to get around that, like caching.
Yes, both Force.com Sites and Site.com features allow you to host webpages on the Force.com Platform. The markup is stored in Visualforce Pages and can use Apex to access records in the Database. I have migrated multiple websites (including our company's www.mkpartners.com) to Force.com using Force.com Sites.
One thing to keep in mind is that you are limited to 500,000 views per month and the rendering of a page with images that are also stored on the platform will incur a single view for the page and a single view for each image. If you already have a very popular website, I wouldn't migrate. If you're a small business or nonprofit, then it should be fine.
Another thing to keep in mind is that dynamic functionality based on records in the database will not work during maintenance windows. There is the ability to upload a static version of your website to be rendered during these windows though.

How in the web farms or cloud the actual data gets synced between the servers inside the web farm or cloud

1- lets say the web app is hosted on some cloud like azure, aws etc.
2- and Let say a user changed his profile details on my web app...
3- i am assuming that the request with the new data will hit one of the servers/VM inside the cloud.
4- Lets say the data has got saved in sql server db hosted on the same server/VM as the request landed on ...
Now the questions ..
What i am really confused about is that ..
1- the data will be saved on one single database in the first place then how it gets synced to other servers (if it happens, i am not sure about this) instantly.. because there is no guarantee that the next request from the same user will land on the same server...
2- and if the above scenario is invalid and there exists a shared database server for all application servers inside the cloud then isn't it going to be useless as ultimately the database server is going to get overloaded ... because all the servers/VMs hosting application will be hitting the same db at once ...
i know it's a wide question and i don't know if i have explained it properly ..
but please ask me about anything which i haven't made clear ..
any help whether it is a good link explaining the insights or a series of Q&A with me, anything would be great.. as i have to design such a mechanism and i couldn't find any standard approaches or that how the market leaders are doing it ...

Database app, accessible from Mac, iPad and Web

I feel very out of my depth with this query, but not being able to do it isn't really an option so I am going to have to learn how one way or another.
I have been tasked with building an application / database for a Chauffeur company. I have done similar things before in Microsoft Access for other customers, hence getting this request, but this customer wants to be able to run the app on their Mac, and not install Windows. My only real experience of coding is HTML/CSS and some VBA when using Microsoft Access. For these Access DBs I have created separate front and back end files to allow multi user access and also remote access (the back end file being kept on the company server).
So onto my query (apologies for dragging it out)...
I need to be able to build something that the single user can open and run on his Mac, so he can view, add, change jobs and their details. He also needs to have the same access on his iPad, although purely viewing would suffice.
As regards the web access, basically he wants to be able to go onto his "Booking System" application, go to "New Job" and send a link to his client, where they would click the link in a browser, fill in the details (Name, Contact Number, collection and drop off addresses, collection date and time etc...) and when they submit this form the details be updated on his booking system.
My issue is I do not really know where to start. I just need some pointers as to where to get started. Is it an issue of building a MySQL database back end and then hosting this somewhere and linking different front ends to it etc...
Yes, with multiple clients, the web is your best answer. For the cheapest hosting route, you can find good, inexpensive PHP and MySQL hosting that will provide what you need. You can design the front end with HTML/CSS, use PHP to develop the logic and data access, and use MySQL to host the data.
The Mac and iPad can access the application via the web URL--you will not be building an iOS app, rather the user will access the web site through a web browser. You can use some pretty neat tools like jQuery UI Mobile to create an app-like experience, but if you need to support multiple clients on a small budget, an iOS app and separate web site is not the way to go.
Make sure you have some PHP expertise available or figure this part out. There are tons of great resources on the web to get started. Good luck!

What is a web service?

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.

Resources