Comments (4)
This is a cool idea, and I think will drive a new Model in the project: ArticleAnalyticDetails
Perhaps this object has a references back to the article and the number of views each day.
What is the difference between a read and a view? Is a Read when a visitor reaches the bottom of the page?
from corewiki.
Is it really necessary to create this new entity now. It seems this only required a simple field "Views" of type int to count the number of views of the article. That can easily be incorporated in the Article entity itself.
Of course if, in the furute the number of analytics details we would like to keep track of grows it might be better to seperate these into a new related entity as you suggest @csharpfritz but for now I think that is too much.
What is your reasoning to start with a seperate entity from the start?
from corewiki.
@summer600 - you're right... I wasn't thinking of YAGNI when I wrote that response.
My thinking in using a separate entity is that we wouldn't want to update the Article record every time someone navigates to that page. The read-caching on an Article page is what we want to drive for later performance concerns.
from corewiki.
@csharpfritz But even if you use a seperate entity on each Read that entity will have to be updated so there are database updated anyway. When you update only 1 field the EF SaveChanges()
will produce an update statement that only updates (sends over the wire back to the database) this one field. You could consider that even more optimal since the Article record will have to be read anyway, but using a seperate entity will require reading that additional entity on a seperate sql round-trip wouldn't it?
And when you consider scaling it up you might switch to pushing read counter updates to a servicebus that is processed in the background, updating the read counter async of the actual Article views.
Then it does not matter either whether it's in Article or not. Wiki's, but Blog posts especially, usually display or use the read counter in a View anyway so putting it in Article will make it more easily available.
If you mean you want to go to a scenario that caches the Article in memory or some sort of external Cache (redis) then wouldn't it still make no difference? You would still want to have access to the read counter for display purposes. So you would cache thos other entity as well, of call some sort of api endpoint that does a counter++ and then again it would not really make a difference because ultimately the database hase to be updated? For other analytics counters like "Application insights" data you are correct but I think the Read counter will be used in the views and is used more like application data than analytics data.
I find it hard to seperate those types of counter, like Blog posts with twitter/facebook/... social buttons with counts below the Blog post or Application insights data. But these usually come from another platform anyway and are not stored locally at all.
I still feel like including the Read counter in the Article Entity will provide no performance or scaling advantage in this particular case and since we are building this out from very small I would keep it simpler to begin with.
from corewiki.
Related Issues (20)
- Refactoring to use UTF8Json
- URLFriendly method is duplicated HOT 1
- During FirstStart allow configuration of alternate Authentication Providers HOT 1
- Azure Project
- Documentation HOT 3
- Extensions: Feature LiveBlogging integration
- Handling dateformatting HOT 2
- Indentation issue while coding HOT 1
- Unable to start CoreWiki due to font awesome source error in libman.js on macOS HOT 2
- Several methods need await to be properly Async HOT 1
- Use Virus Total API
- Feature: Protected articles HOT 1
- Add option to delete user(s) HOT 3
- Need user Display names, not email addresses HOT 6
- New login thoughts
- Scan wiki content for possible PII of other users, and let those users know
- Add dependabot.com to the repo to get updates of packages HOT 1
- CoreWiki throws Errors if only dotnet core 2.2 is installed HOT 2
- Are there any plans to upgrade to ASP.NET Core 3.1?
- Live demo is down in 2023 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corewiki.