Soppose the following scenario :
Some system generates a RSS feed with all updated or new items it has .
Other system must consume this feed and performe some action with each item from this feed.
So far so good .
Now I want to put more than one consuming service at the same time , for example for performance issue and for scalling .
What will be the best way to avoid of the same item being proceseed on more than one consuming service ?
Related
I am working on an .net application that needs to present to the user data from 3 different platforms and any actions taken are also saved to the respective databases. What is the best design pattern for data access ,I am thinking Factory would be best but i need some advice as I am kind of new to this approach.
Lets say we have 5 different websites that are independent of each other completely , but similar . Products added to these different sites need to be reviewed in a single application and each product is either approved to rejected by the user . We dont need to combine the data , but the UI is the same , based on what data they are looking at , we just need to save the actions to that particular db.
Yes, and is most common to use.
Look this site: http://www.primaryobjects.com/CMS/Article81.aspx
Contains a simple step to step how to create a database factory in C# for web pages.
I would say an Observer pattern:
(for receiving messages of new products if you are not polling manually)
coupled with a Command pattern:
(for agnostically rejecting/approving a product and sending it off to be processed by its DB)
You could then interface the brokering class with a Factory pattern. Im just curious on how you would get notified of a new product: polling, pushing, sockets, etc since that would open up more options for your solution
I have a meteor project featuring products. They are all in a Products collection.
At the moment, I have only 50 of them. So I subscribe to the entire collection and then filter it client side.
Bu what if my project gets a lots of products. Let's say 10.000. This strategy won't work at all. The application will be slow and will take like forever to load the first datas. What would be the most efficient ?
1 => the classic way : no subscription, I just make meteor method server side and I make calls client side to get the data I want. (this one, I know how to build)
2 => the more meteory way (I feel more into that one) : make a subscription, but filtered and paginated. Meteor.subscribe('products', );
Is it viable on a large scale ? And how do I achieve that ? I'm not sure how to start with the pagination stuff. Do I update my subscription or start a new one ?
I use iron-router. And the first problem I have to tackle is caching the result. In a perfect world, if a user makes a first search, then an other and then goes back to the first one, I'd like the app to keep the first results. When I put my subscription in the waitOn hook, all the datas are lost when I go on another route.
From what I know it seems that Meteor Framework stores part of data on the client. It's clear how to do it for personal todo list - because it's small and you can just copy everything.
But how it works in case of let's say Q&A site similar to this? The collection of questions are huge, you can't possibly copy it to the client. And you need to have filtering by tags and sorting by date and popularity.
How Meteor Framework handles such case? How it partition data? Does it make sense to use Meteor for such use case?
Have a look at the meteor docs, in particular the publish and subscribe section. Here's a short example:
Imagine your database contains one million posts. But your client only needs something like:
the top 10 posts by popularity
the posts your friends made in the last hour
the posts for the group you are in
In other words, some subset of the larger collection. In order to get to that subset, the client starts a subscription. For example: Meteor.subscribe('popularPosts'). Then on the server, there will be a corresponding publish function like: Meteor.publish('popularPosts', function(){...}.
As the client moves around the app (changes routes), different subscriptions may be started and stopped.
The subset of documents are sent to the client and cached in memory in a mongodb-like store called minimongo. The client can then retrieve the documents as needed in order to render the page.
I am working on an StoryBoarding application,it is a slide based application in which the authors can put several components like image , sound , captions etc in each of the slide.A collection of slides will make a storyboard.This application will be deployed on a web server (sharepoint + IIS , and php+apache), and several users can collaborate with each other for authoring or reviewing the storyboard.In my application I also want to support auto save ,which will keep on storing the state of the storyboard.User can also save at any point of time by clicking the save button.
I am confused about how to store the state of the storyboard.
1)Presently I am doing this by passing all the storyboard data to a dot net web-service and then that service is storing images,caption etc in their respective tables into a database .
2)Another approach possible is to store the model of the application as a serialized object into the db , which will be more convenient since separating the components of the model (like images,captions etc..) will not be required and also restoring the state of the objects in the application will be easy .
I have two doubts about using approach 2 :-
i) I want the the saved storyboard to load quickly, for which I would like to support the partial so that lighter objects like caption can be loaded quickly but other heavier objects like image,video etc can be loaded on demand. Using approach 2 , do I have to send the whole data in one go or is there way to support partial loading ?
ii) How to implement the auto save feature when using approach 2, for every auto save do I have to send the whole serialized object again back to db or is there a way to send only the changed part of the model to be stored in db .
Please suggest which approach would be better to use for this application , and also answer afore mentioned doubts regarding using approach 2 .
If i would be working on such Application i will use Approach DIVIDE AND RULE, a design seprate logic to save and retrive each components like Images, sound etc, because it can easly handles any modification and enhancement in application,
Another thing is that it will take longer time to save, update and load data from backend if you use approach 2.
I am with approach 1.
Hopes that helps
I'm thinking of a architectural way of displaying messages in our application (Flex-Asp.NET-SqlServer), mostly messages that announce for instance a downtime.
Currently I was thinking of creating a table FlexMessage that holds the name of a message (based on that name I now where to put in Flex) and the value (the message itself). As a result however, someone will have to create these messages and also delete them when they are no longer valid. So, thinking further, I thought of creating messages having a startdate and enddate, so an interval in which they need to be displayed. Like this, someone could login to the management part and create a message that needs to be displayed from a certain date until a certain date.
I could also hardcode it in the Flex Application, but that would mean putting a new build online (of the swf) each time something changes with a certain message. No good idea I guess.
Is there a better way for this that I haven't thought about?
One way to do this is to place your messages in an RSS feed, then read that feed from the Flex application.
There is an example of how to do this here: http://www.artima.com/weblogs/viewpost.jsp?thread=23819