Skip to content

Using S3 Glacier with ElasticSearch

0

We have an ElasticSearch instance running 7.9 on AWS that we use to store logs.

Currently we have a lambda that runs and deletes all indexes older than our retention period of 14 days.

However, now, instead of deleting these logs, we want to move to S3 Glacier Instant Retrieval. We were going to write two lambda functions, one to archive and then delete the data from ElasticSearch and another to allow us to retrieve and reimport the data.

Each index would be around 50GB so I'm worried about the 15 minute Lambda timeout.

Is this the best approach (assuming we cannot use warm/ultrawarm/cold storage elasticsearch instances)?

asked a year ago287 views

1 Answer
0

For your use case of archiving 50GB ElasticSearch indexes to S3 Glacier Instant Retrieval, there are some considerations with your Lambda approach.

S3 Glacier Instant Retrieval is a good choice for your scenario as it provides millisecond retrieval times for data that's accessed infrequently (approximately once per quarter), making it suitable for logs you may need to access occasionally but don't want to keep in your primary ElasticSearch storage.

However, the 15-minute Lambda timeout is a valid concern when dealing with 50GB indexes. This could be problematic for both the archiving and retrieval processes. Instead of relying solely on Lambda functions that might time out, consider these alternatives:

  1. Break down the process into smaller chunks: Use Lambda to orchestrate the process but have it work on smaller portions of data at a time.

  2. Use Amazon ECS or EC2 for the heavy lifting: These services don't have the same timeout constraints as Lambda and would be better suited for processing large amounts of data.

  3. Implement a step function workflow: AWS Step Functions could coordinate multiple Lambda functions working on portions of the data.

  4. Consider using S3 lifecycle policies: Once your data is in S3, you can use lifecycle policies to automatically transition it to Glacier Instant Retrieval after a certain period.

If you do proceed with Lambda, ensure you're optimizing the process by:

  • Compressing the data before archiving
  • Using efficient serialization formats
  • Implementing checkpointing to resume operations if a timeout occurs

For retrieval, remember that S3 Glacier Instant Retrieval provides millisecond access to your data, so you won't face the retrieval delays associated with other Glacier storage classes.
Sources
Secure archive storage – Amazon S3 Glacier storage classes – AWS
Cost-optimized log aggregation and archival in Amazon S3 using s3tar | AWS Storage Blog

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.