How to layout a subscriptions database (like youtube)? - database

Like youtube, i have a usertable, a table with objects (videos) and a table with categories.
Now, I want a user to be able to subscribe to a category, but how do I do this effectivly? I would need a table for keeping track of which categories a user subscibes to (many-to-many relationship), but I also need to keep track of which objects (videos) that a user hasn't watched yet, so how do I do that?

Just have another table that tracks which videos a user HAS watched. Then when selecting which videos to show to the user check them against the watched video table to make sure they haven't seen it yet.
You can then also use this table to show the user a list of all videos they have watched, or display a complete list of which videos are currently being watched on the site etc.

Why not use RSS? That way, a user can manage their own subscriptions and you don't have to store all the subscription info and then run a process based on these subscriptions. Their RSS reader will take care of that for you.
This CodeProject article has some details about how to serialize your classes into RSS.

Related

Knowing when to utilize a database

I've been told that you should really only use a database if your data will be updated in some way by the end user. But what if your website is "static" in the sense that the user doesn't update anything?
For example maybe your website displays a map of the USA and you can click on each state, click on a few cities in each state and view data for those areas(population, demographics, climate history, whatever). Is a database in this situation appropriate? The user isn't updating anything but you can end up with some very large datasets depending on what information you want to display. Would a database be appropriate for something like this?

Reading and updating data from outside the widget

Is it possible to first request the data of some widget, and then update the data or add new ones?
Example: Product card widget. There are several of them on the page. I go to the admin panel and by pressing the button the data in all widgets is updated based on those received from other sources (API of a third-party site). In short, the synchronization of data in some widgets based on some data received from another site.
Whatever the manager manually checks, does not waste time changing prices, the availability of balances based on data from a friendly site, from where I get the data.
How can one read widget data on some page via PHP?

Google Place API Flutter syncing with custom city database table

I am working on a taxi booking app where routes between cities are predefined in the database with pickup and drop city.
Without google place API things are working fine.
Now I want to make a dropdown in flutter where it can search any city in the country and if those pickup and drop cities are found in the database then display the route from DB otherwise it will just log an entry in the booking inquiry.
How to map a city data from google to a custom city table where I have cities' names?
This is more of a choice where developers will use their ideas and implement this in their own way. This is though not a right platform to ask this kind of question. Yet I'll try to help in my own way.
In my opinion you don't need to map anything for this case. You can simply check for user input on dropdown and check with your stored cities. If no matches found, you keep the entry for inquiry and if a match is found, you can use Google's Direction api to find route and draw on map.

How to make a page with a list of Users in a Salesforce Community?

So I'm completely new to Salesforce Communities and working with the Experience Builder which is where I think this task would need to be done.
I want to display a list of Users in the Community (specifically only ones associated with the same Account as the current User) showing a certain set of fields and allowing in-line edits.
I see there's already a set of pages for User list, profile, and related list, but the User List page is blank by default. I found the Record List component for Experience Builder, but it does not appear to support User.
I'm considering making a Lightning Component that displays my table of Users to then use as a component in Experience Builder, but I'm not sure how involved of a process that would be or if there is a more straightforward approach.
How can I go about making this?
(If it matters, when I first made the Community I believe I selected "Customer Service")

Asynchronus Infinite scrolling to display data in table view in reacts app

I am developing my first reacts application, I go through various reacts plugins for data grid with infinite scroll option but didn't get proper solution.
What I have and What I need is:
I am fetching the users list from 3rd party API.
At a time only 50 users records fetch via API.
I have around 10000 users records and need to display first_name, last_name, email with Edit/Delete link in table view.
I need to append the next 50 users in the list when user scroll the window/div and it will happen till all the records are displayed.
I also need the sorting and searching option on first_name so that user can sort/search the user by first_name. It also needs to be done via ajax request to 3rd party API.
Please suggest me the good reactjs component/plugins to achieve this.
Thanks in advance!
Take a look on react-data-grid, it's full of features and really simple to use
I'm using react-infinite-scroller and working fine. Easy to implement.

Resources