Will the Database hustles if I update a field every 5 seconds? - database

I am developing a web app which needs to check the internet if got connection or not.
If got connection, it will update a field in the db every 5 seconds.
Basically, it's a chat-like web app wherein it will update a field for datetime last seen online.
So that it will show on the other users who is currently online/logged in.
I will implement the snipplet in all the pages so that it will update the DB while you navigating the pages.
Cheers!

No self respecting database should have an issue with that.

Related

Cannot login to ABP.io. No users in database

I'm trying out the guide here: https://docs.abp.io/en/abp/latest/Getting-Started-Angular-Template
The DB was created successfully in the migration as per the guide however the ABPUsers table has no records. I've used the previous framework AspNetZero and it created 1 or two user records (admin being one of them). Any idea why there are no users?
I skipped a part in the above link. I needed to set .DbMigrator as default project and then run it once.

How to show selective UI features?

I have a UI that needs to either show icons on a timeline view or not based on user profile. How can I show for some users and not for others? For example : the Sports Admin team needs to see the scores of all teams over time in the view (showing all years visually) but the players (when they login to the same web app) only see the timeline view with their team's performance over the years (not other details for a particular year). How can I achieve this? I am using Angular JS and javascript
I have looked into role based SSO login and show selectively and also cookies. My goal is faster performance - meaning the page needs to load fast.
I was able to find a solution for the problem above that we have been facing. After many design sessions, the best approach was to have a "User Settings" link that would save the preferences at a backend database per user id that's already captured via SSO login. The backend returns data based on the user settings as the queries to get data from backend are now made dynamic to take the selections from User Settings into account while querying the backend. As a result the front end shows data specific to user.
Tested this and seems to work perfectly without any affecting any page load performance whatsoever.

How to notify users when record is updated by another user (SQL Server)

When multiples users are updating the same record at that time how to notify other users that someone has updated the record recently.
So is there any provision that other user will get the updated copy of the record or will get the instant notification?
How would you come to know that record is already updated. You should use optimistic locking for this. When you have implemented optimistic locking. When you will try to update the record which is already updated. It will throw concurrency error. That you can display on UI with proper message. This record is already updated Please refresh the page and try again.
You can use web application where instant notification will show. SignalR Javascript library handle it with asp.net using SQL Dependency.

Refreshing demo website data for different timezone?

I have a demo site which is open for public access to login, view, and try out our website.
The data is editable for public so I am refreshing the database of this demo site every midnight local time. Refreshing here means dropping the entire database and then re-importing a template database. The database I'm running is MySQL 5.7.
The problem is that there is a 3-5 minutes downtime when my script is refreshing the database.
This is not an issue for the clients on my timezone as it's midnight here but on the other side of the world, customers are complaining as they think that the demo site is down for some reason.
How do you approach this issue? I believe a lot of sites provide demo sites and they should refresh their data on a constant basis too (daily in my case).
Thank you!

Integrating notifications/messages to the client in an AngularJS + ASP.NET Web API app

I'm creating a SPA application with AngularJS at the client side and ASP.NET Web API as backend. My database is SQL Server 2012. There will be users which have a favourite sports team and a simple icon in the UI displaying the number of new articles/news/comments added or whatever connected to their favourite teams.
What I'd like to achieve is the following: Whenever a record about their team is inserted (record with TeamID column value for example equal to the user's favourite team ID), that notifications count icon should be updated immediately (just like Facebook's notifications - it's updated when a friend has posted on your wall or has tagged you and so on). How can I best achieve this?
What I'm thinking of for now is just setting an interval function in AngularJS to check every 30 seconds, let's say, if there are new records in the database making a request to a Web API controller. Of course this suggests a lot of checking for when the user is logging out - when was the last check, what will be the date to check against next time he/she logs in and so on.
You can use signalR for this. It's a framework for real time communication. Check out this to get if you want to get started. It can easily be used together with angularJS.
What you are looking for is push
Sadly i never used it so i don't know much about it, but i think you should use technologies like pusher

Resources