Pricing criteria of AWS S3 - amazon-web-services

I am confused about pricking criteria in aws s3.
Let's assume
SELECT * FROM TABLE => result 1000 rows
Is this command 1000 requests or 1 request?

If you using S3 Select to query, it is a single request and you get charged for every 1000 requests and charged at the same rate as object GET requests
If you are using Athena to query S3, the charge would be for the amount of data retrieved and how the file is stored like zip or parquet format

AWS S3 Select charges for the bytes scanned ($0.00200 per GB) and the bytes returned ($0.0007 per GB).
The charges are broken in your billing management console Under Billing>Bills>Details>Simple Storage Service>Region> "Amazon Simple Storage Service USE2-Select-Returned-Bytes" and "Amazon Simple Storage Service USE2-Select-Scanned-Bytes"
Using limit, where clauses or having a compressed file reduces the bytes scanned. The service supports gzipped Parquet files which is fantastic. I was able to reduce file sizes by 90% and take advantage of columnar data format rather than csv.

Related

S3 and large files backup

I have large files and I am looking for a place where I could store files (databases dumps). AWS S3 is good for backups? I have already exceeded all limits.
I have a few questions:
I am using API and CLI. Which solution is cheaper to send files via API? "aws s3api put-object" or "aws s3 cp"?
"2,000 Put, Copy, Post or List Requests of Amazon S3". How is consumption calculated? In HTTP requests or bytes? Ac Currently, Currently, I have level of consumption for 20 files per day: 2,000.00/2,000 Requests.
Are there any paid plans?
Everything you need to know is at the Request Pricing section of the S3 Pricing page.
Amazon S3 request costs are based on the request type, and are charged
on the quantity of requests or the volume of data retrieved as listed
in the table below. When you use the Amazon S3 console to browse your
storage, you incur charges for GET, LIST, and other requests that are
made to facilitate browsing. Charges are accrued at the same rate as
requests that are made using the API/SDK.
Specific pricing is available at that page (not included here because it will change over time).

Is AWS Cloudsearch Scalable?

I have 500MB worth of data to push to cloud search.
Here are the options I have tried:
Upload directly from console:
Tried to uplaod the file, there is a 5 MB limitation.
Then uploaded the file to S3 and selected the S3 option,
Upload to S3 and give S3 url in the console:
Fails and asks to try command line.
Tried with command line
aws cloudsearchdomain upload-documents --endpoint-url http://endpoint
--content-type application/json --documents s3://bucket/cs.json
Error parsing parameter '--documents': Blob values must be a path to a file.
OK, copied the file from s3 to local and tried to upload,
Tried with local file and cli:
aws cloudsearchdomain upload-documents --endpoint-url http://endpoint
--content-type application/json --documents ./cs.json
Connection was closed before we received a valid response from endpoint URL: "http://endpoint/2013-01-01/documents/batch?format=sdk".
Anyway to get CloudSearch to work?
As I understand the question, this is not about the scalability of Cloudsearch as per the Question Header, but it is about the limitations of uploading, and how to upload a large file into Amazon Cloudsearch.
The best and optimal solution would be to upload data by chunking it. Break your document into batches and upload data in batches. (But keep in mind the limitations associated)
The advantage of this is, if you have multiple documents to submit, submit them all in a single call rather than always submitting batches of size 1. AWS recommends to group (up to 5 mb) and send in one call. Each 1,000 batch calls cost you $0.10, I think, so grouping also saves you some money.
This worked for me. Given below are a few guidelines to help tackle the problem better.
Guidelines to follow when uploading data into Amazon Cloudsearch.
Group documents into batches before you upload them. Continuously uploading batches that consist of only one document has a huge, negative impact on the speed at which Amazon CloudSearch can process your updates. Instead, create batches that are as close to the limit as possible and upload them less frequently. (The limits are explained below)
To upload data to your domain, it must be formatted as a valid JSON or XML batch
Now, let me explain the limitations associated with Amazon Cloud search related to file uploads.
1) Batch Size:
The maximum batch size is 5 MB
2) Document size
The maximum document size is 1 MB
3) Document fields
Documents can have no more than 200 fields
4) Data loading volume
You can load one document batch every 10 seconds (approximately 10,000
batches every 24 hours), with each batch size up to 5 MB.
But if you wish to increase the limits, you can Contact Amazon CloudSearch. At the moment, Amazon does not allow to increase upload size limitations.
You can submit a request if you need to increase the maximum number of
partitions for a search domain. For information about increasing other
limits such as the maximum number of search domains, contact Amazon
CloudSearch.

Number of S3 requests generated by Redshift's UNLOAD Query

When unloading data from Redshift to S3 with PARALLEL ON, results of the select statement are split across a set of files as described in the Redshift Documentation. How does this translate into number of requests sent to S3 endpoint ?
Ex - If the UNLOAD query ( with PARALLEL ON ) generated 6 files in S3 bucket, does that correspond to 6 PUT requests on S3 ? Or is the number of requests received by S3 via this UNLOAD query execution a higher number?
I would appreciate it if you could briefly clarify.
If you're worried about cost then you're looking in the wrong place.
PUT requests in Amazon S3 (in a US region) are a half-cent per 1000 requests. Compare that to a Redshift cluster that is a minimum of 25c per hour (which is still rather good value).
Take a look at your monthly bill and S3 request pricing is unlikely to feature in your top costs.

Amazon Kinesis Firehose Buffering to S3

I'm attempting to price out a streaming data / analytic application deployed to AWS and looking at using Kinesis Firehose to dump the data into S3.
My question is, when pricing out the S3 costs for this, I need to figure out out how many PUT's I will need.
So, I know the Firehose buffers the data and then flushes out to S3, however I'm unclear on whether it will write a single "file" with all of the records accumulated up to that point or if it will write each record individually.
So, assuming I set the buffer size / interval to an optimal amount based on size of records, does the number of S3 PUT's still equal the number of records OR the number of flushes that the Firehose performs?
Having read a substantial amount of AWS documentation, I respectfully disagree with the assertion that S3 will not charge you.
You will be billed separately for charges associated with Amazon S3 and Amazon Redshift usage including storage and read/write requests. However, you will not be billed for data transfer charges for the data that Amazon Kinesis Firehose loads into Amazon S3 and Amazon Redshift. For further details, see Amazon S3 pricing and Amazon Redshift pricing. [emphasis mine]
https://aws.amazon.com/kinesis/firehose/pricing/
What they are saying you will not be charged is anything additional by Kinesis Firehose for the transfers, other than the $0.035/GB, but you'll pay for the interactions with your bucket. (Data inbound to a bucket is always free of actual per-gigabyte transfer charges).
In the final analysis, though, you appear to be in control of the rough number of PUT requests against your bucket, based on some tunable parameters:
Q: What is buffer size and buffer interval?
Amazon Kinesis Firehose buffers incoming streaming data to a certain size or for a certain period of time before delivering it to destinations. You can configure buffer size and buffer interval while creating your delivery stream. Buffer size is in MBs and ranges from 1MB to 128MB. Buffer interval is in seconds and ranges from 60 seconds to 900 seconds.
https://aws.amazon.com/kinesis/firehose/faqs/#creating-delivery-streams
Unless it is collecting and aggregating the records into large files, I don't see why there would be a point in the buffer size and buffer interval... however, without firing up the service and taking it for a spin, I can (unfortunately) only really speculate.
I don't believe you pay anything extra for the write operation to S3 from Firehose.
You will be billed separately for charges associated with Amazon S3
and Amazon Redshift usage including storage and read/write requests.
However, you will not be billed for data transfer charges for the data
that Amazon Kinesis Firehose loads into Amazon S3 and Amazon Redshift.
For further details, see Amazon S3 pricing and Amazon Redshift
pricing.
https://aws.amazon.com/kinesis/firehose/pricing/
the cost is one S3 PUT for any operation done by kinesis, not for a single object.
so one flush of firehose is one put:
https://docs.aws.amazon.com/whitepapers/latest/building-data-lakes/data-ingestion-methods.html
https://forums.aws.amazon.com/thread.jspa?threadID=219275&tstart=0

What AWS CloudWatch Logs are using for storage?

I started working with amazon CloudWatch Logs. The question is, are AWS using Glacier or S3 to store the logs? They are using Kinesis to process the logs using filters. Can anyone please tell the answer?
AWS is likely to use S3, not Glacier.
Glacier would make problems if you would want access older logs as to get data stored in Amazon Glaciers can take few hours and this is definitely not the reaction time one expects from CloudWatch log analysing solution.
Also the price set for storing 1 GB of ingested logs seems to be derived from 1 GB stored on AWS S3.
S3 price for one GB stored a month is 0.03 USD, and price for storing 1 GB of logs per month is also 0.03 USD.
On CloudWatch pricing page is a note:
*** Data archived by CloudWatch Logs includes 26 bytes of metadata per log event and is compressed using gzip level 6 compression. Archived
data charges are based on the sum of the metadata and compressed log
data size.
According to Henry Hahn (AWS) presentation on CloudWatch it is "3 cents per GB and we compress it," ... " so you get 3 cents per 10 GB".
This makes me believe, they store it on AWS S3.
They are probably using DynamoDB. S3 (and Glacier) would not be good for files that are appended to on a very frequent basis.