Open rexim opened 9 years ago
I can propose a more robust solution to the mentioned problem:
POST
request to staging area (and store it to the database);Staging area quotes may be automatically cleaned up after a while - e.g. weekly.
@ForNeVeR that's a good idea!
@ForNeVeR I suggest to make a staging area as an in-memory map (id -> text) that has a limited size and deletes old entries on an insert operation. We don't need to persist this information and such approach doesn't require to clean up anything weekly.
I wouldn't say that such in-memory storage is widely accepted solution in web today. For example, if Heroku wants to stop our application (as it always do) - all staging data will be lost. Are you really sure we want exactly this? Are you really sure you are mixer?
@ForNeVeR the data in the stage area is needed only for 1-2 minutes. Or even less. Then it can be easily thrown away.
Heroku stops our application when nobody uses it for a while (this time period is definitely greater than 1-2 minutes, we can check the official documentation if you want). In case the application is stopped, staging the data by a POST request will trigger heroku to start it up. And then everything should work as expected.
Well, if you want then let's try to implement your proposal.
On the other hand, in-memory approach with size-limited map is not that scalable... I mean at some amount of active REST users the staging area will be wiping very fast. I'll think about it. :)
After a little conversation in our jabber conference we decided to use the database solution.
It should work like this:
http://www.loglist.net/quote/new?content=<quote-text-in-base64>
— for example, for "Hello, World" it will look like http://www.loglist.net/quote/new?content=SGVsbG8sIFdvcmxkThis feature can be useful for https://github.com/codingteam/horta-hell/issues/306