7 Best easy to follow document rotation ideas

  • by

Here we go! I have written down the 7 best rotation strategies if you are considering implementing document rotation in your system. Here system may be server storage, or your laptop, or any other data store to consider.

Before we go through the list of document rotation ideas, I would like to clarify that items I have populated here were out of my exposure to various systems so far. If you have some other way other than the one mentioned here, then let me know by this post comment so that others may be aware of them.

I will give you a detailed context about each one of them on this page so that you can pick one and start implementing the same on your system. Please also note that I have only mentioned the ideas and their examples (few). Implementation of such ideas may be included in future, if I did, I will link them here respective to the item.

Here’s the list!

  1. Document rotation based on expiry date
  2. Document rotation based on API trigger
  3. Document rotation based on disk space availability
  4. Document rotation based on process stage
  5. Document rotation based on quantity
  6. Document rotation based on priority or order
  7. Document rotation based on its Name

Document rotation based on Expiry period

Expiry period for a document will be mentioned in its name itself or we can rotate the document by checking the modified/created date. In both the ways, there will be event trigger calling a script to check the expiry and will attempt to rotate the document accordingly.

Let’s say you wanna add the date time in the name itself. A sample filename may look like:

In this case, the document time at which it has been created is mentioned in the filename. By reading the filename we can check for expiry and rotated to recycle bin or to archive directory.

In AWS cloud, if your document are no longer used and you want it at later point of time, then you can write a lambda function which can move the document at S3 bucket to AWS Glacier.

Document rotation based on API trigger

Let’s say you have collected KYC document from your customer which we need to archive after successful processing of their subscription. Now we should rotate the document to the archive only if the document has been processed. This can be accomplished by the help of an API trigger!

Create a Lambda function to rotate the document to Glacier or to another S3 bucket. Integrate this lambda function to AWS Gateway API service. Create an API end point and then test whether on successful invoking of it rotates the document to the archive as configured in the Lambda function.

You need to configure the API gateway endpoint to accept filename as input to it. Hence I would recommend you to go for HTTP GET method with filename in the query parameter or using HTTP POST with filename and related information in the body payload.

Finally configure the endpoint details in the end of the document KYC processing application.

Document rotation based on Disk space availability

Disk space availability based document rotation is suitable for scenarios when you don’t need a file if it really affects the performance or runtime of your system.

An example can be log files directory. Most modern application services are built with log file rotation. You need to configure the overall size of the log files so that the older one will be archived or deleted.

If you are writing a strategic approach to your application by yourself, then keep a property in your application property file and read the total log file size to maintain. Keep a trigger that checks the log directory periodically and when the total size breaches, then delete most outdated log files from the directory.

If your application in the system does not have this by native, then you can check your application disk space by writing a script and configuring it in cron schedule. Alternatively you may install a monitoring tool that can monitor the disk space.

The monitoring tool can then make decision to notify the disk administrator or clean up the log directory by itself.

Document rotation based on process stage

Let’s say you are designing your business process flow using a BPM tool (like Pega, or Appian or some other tool). There are two situations irrespective of your business flow that you want to rotate the document from the actual processing: first-when the process has been approved; second-when the approval reject has been cancelled or rejected.

So, as the header of this section says, depending on the process stage document in the flow will be parked or moved to the appropriate destination.

Some BPM tool does have native support when configured. If you are developing a handmade flow processor by yourself, then you need to wire these things.

Document rotation based on quantity

There are times when you don’t need lot of documents when the required one’s are available. When you requested two mandatory document and the end user has uploaded more than the requested one, then you can write a logic to rotate the extra documents to trash, as it would unnecessarily occupies your system storage space.

In case of cloud, you would be paying for the storage size you are using. Even if you have EBS volumes, and have huge data per 1000 user base, then you need to size up the volume or to spin up another one.

Try to maintain minimalist document strategy as this would help you maintain the system on long run.

>ls -l | wc -l

The above shell command will give you the total number of files in a directory. Based on the output of this command you can design and write a shell script to rotate the documents.

Alternatively, if you use EBS volumes for document storage, you can use AWS SDK and write a simple python script to upload those trailing documents by modified and created time to S3 bucket. All you have to do is to configure AWS S3 access keys to authorize access to your buckets.

Document rotation based on priority

You have a distributed system and long queued documents to process. You may get this situation when you want to process customer KYC the day after your business partner referred ton of their customer base to your online/offline service.

Now based on the priority you can help the system to process and rotate the documents. May be you can prioritize based on the subscription plan they are opting for.

Document rotation based on name

If a service after processing a document marks it with a renaming, then a trigger can rotate those marked documents later periodically.

Original filename: document.doc
After marking: document_processed.doc

By changing the name of the document, by appending a key term at the end of the name (not after the filetype), you can let other manager/cleanup service to pick them for rotation.

This is achieved easily with the help of a wildcard pattern matching with _processed.

ls -l | grep *_processed.doc

This command will return all the documents that are marked with _processed.

Bonus Idea: Using document tags!

If you are using a CRM software suite, you can make it configure to mark the document while processing with a tag named “processed”.

Later you can process or rotate all the documents with this tag. This is similar to the previous idea but preserves the original document name.

If you have got an idea while you were going through the above, please share the same below in the comments. Let the whole world knows!

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Leave a Reply

Welcome to CloudiKnow.com blog, a platform to share knowledge and solution experience related to public cloud is base design of this site.

You can start the cloud journey right from here!
Please bookmark this page by pressing simply CTRL+D.