[{"data":1,"prerenderedAt":1440},["ShallowReactive",2],{"nav-products":3,"articles-how_to":10},[4],{"name":5,"tagline":6,"to":7,"isInternal":8,"icon":9},"Valdras Gate","no VPN licenses to manage","\u002Fproducts\u002Fgate\u002F",true,"\u002Fpublic\u002Fimg\u002Fproducts\u002Fgate\u002Fgate_logo.png",[11,150,441,1211,1303],{"id":12,"title":13,"author":14,"body":15,"category":138,"cover":139,"date":140,"description":141,"extension":142,"featured":143,"isFeatured":8,"meta":144,"navigation":8,"path":145,"preview":146,"seo":147,"stem":148,"__hash__":149},"articles\u002Farticles\u002Fhow_to\u002F2020-12-19-how-to-lower-aws-costs.md","How to lower AWS Costs","David Gatti",{"type":16,"value":17,"toc":130},"minimark",[18,27,32,35,39,42,45,48,59,64,67,70,73,82,86,89,92,95,99,102,106,109,113,116,120,123,127],[19,20,21,22,26],"p",{},"This article is meant for CEOs, CTOs, and Managers. The goal is to give a better understanding of how to lower AWS costs by answering a common raised question by clients: ",[23,24,25],"em",{},"What is the simplest way to lower the AWS bill","?",[28,29,31],"h1",{"id":30},"the-mysticism","The mysticism",[19,33,34],{},"AWS costs are wrapped in mysticism due to mysterious practices by companies that specialize in this field. The reality is simpler than you might think, otherwise these companies would not hide behind big words and convoluted explanations.",[28,36,38],{"id":37},"the-aws-billing-page","The AWS Billing Page",[19,40,41],{},"AWS provides you with a very simple to use billing page, which brakes down all your costs based on the service, and the region. This makes it easy to find the biggest expense in the account.",[19,43,44],{},"More importantly if you have an organization account and under that you have dozens of other AWS accounts, the billing page also provides you with a brake down based on the individual account under the organization. This makes it simple to find the account that is generating the biggest costs, while allowing you to then drill down to the service, and region.",[19,46,47],{},"The billing page is the most important thing to use when it comes to getting an idea of what is going on in the account. Once you know where the money goes, we can go into the details and figure out if there is something that can be changed to lower the monthly bill.",[19,49,50,51,58],{},"By the way: if you want to ",[52,53,57],"a",{"href":54,"rel":55},"https:\u002F\u002Fconsulting.0x4447.com\u002Farticles\u002Fknowledge\u002Fthe-benefits-of-aws-organizations.html",[56],"nofollow","learn more about the benefits of AWS Organizations",", check out the article.",[60,61,63],"h2",{"id":62},"pay-by-the-hour-services","Pay-By-The-Hour Services",[19,65,66],{},"The majority of the costs in your organization are going to come from EC2, RDS and similar Pay-By-The-Hour type services. This are the most used services, and most importantly AWS charges you for these services the moment they are turned on, regardless of the load.",[19,68,69],{},"The majority of the time, these services are turned on by employees temporarily just to perform a test, or run a one time job, but will forget to turn them off. Services could be left on for years, while your bank account is being drained for servers that have 0.45% CPU time.",[19,71,72],{},"Thankfully this problem can not only can be quickly identified, but also be quickly solved by just simply turning off those unused servers. The simplest approach is to stop all the servers with less then 1% CPU time in the case of Linux, and 3% in the case of Windows instances. This approach allows you to stop paying for the servers, but also turn them back on when they are actually needed (Because if they are, someone somewhere should start screaming).",[19,74,75,76,81],{},"On the other hand, if your servers are needed, then you are probably not taking advantage of the Reserved Instances features that AWS provides. With this service, instead of paying by the hour, you can pay up to 3 years upfront, and thus ",[52,77,80],{"href":78,"rel":79},"https:\u002F\u002Fconsulting.0x4447.com\u002Farticles\u002Fhow_to\u002Fhow-to-lower-ec2-costs.html",[56],"lowering your bill by 40% to 75%",", check the article to find out more.",[60,83,85],{"id":84},"serverless-services","Serverless Services",[19,87,88],{},"The next big contributors are all of the serverless technologies that AWS offers. In contrast to the pay-by-the-hour onset, this one generates a charge when actually used. This means that there might not be a quick fix. To reduce the price for these services, you’ll have to change how you use them. In the case of S3 it might be as simple as enabling Intelligent-Tiering on a S3 bucket, but in other cases you might have to change the code of the application, for example how DynamoDB is being used.",[19,90,91],{},"Since we are discussing DynamoDB already - when you use this NonSQL database in On-Demand mode, you get charged by how many queries to it you make, and also how much data is being moved back and fort. If the application using this services makes lots of poorly constructed requests, or the data is structured in a way where the data transfer is high, then you you’ll pay incredible amount of money on a daily basis.",[19,93,94],{},"In situations similar to these, you’d need an expert to look in to the problem, and come up with a solution, and then this solution will have to be implemented correctly to lower the bill.",[28,96,98],{"id":97},"prevention-mechanisms","Prevention Mechanisms",[19,100,101],{},"Overall the best approach is to always educate people to help them make better decisions when they use all that AWS has to offer. There also some simple ways to remind them of what they have learned.",[60,103,105],{"id":104},"for-pay-by-the-hour-services","For:  Pay-By-The-Hour Services",[19,107,108],{},"The IAM services has the idea of Policies, this are documents that specify what a IAM User can do in the AWS account. It can be as simple as the user has only access to EC2 Instances, or you can extend it to include which type of instances can be launched by the user, and even specify the region in which they can do that. With a policy like this you can be confident that nobody will launch expensive instances without permission. This is true for any service that is pay-by-the-hour.",[60,110,112],{"id":111},"for-serverless-services","For:  Serverless Services",[19,114,115],{},"Sadly, there is no way to have a policy that prevents developers from making queries the wrong way, or storing data the wrong way. The best solution here is to train the team so they can learn all the best practices for a given AWS Service.",[28,117,119],{"id":118},"good-monitoring","Good Monitoring",[19,121,122],{},"Lastly, a big part of keeping a close eye on the AWS expenses is good monitoring. Each service that is being used should have CloudWatch Alarms monitoring thresholds, and sending notifications when there is something that goes over your set limits. Of course in some cases this takes some effort to get the threshold just right, but once you do, you’ll know exactly when and what is causing a problem.",[28,124,126],{"id":125},"to-sum-it-up","To Sum it Up",[19,128,129],{},"Depending on your situation, I hope that you’ll be able to (even today!) lower your AWS bill substantially. If not, you should now have a good understanding on what to look for, and what to ask the people in your organization.",{"title":131,"searchDepth":132,"depth":132,"links":133},"",2,[134,135,136,137],{"id":62,"depth":132,"text":63},{"id":84,"depth":132,"text":85},{"id":104,"depth":132,"text":105},{"id":111,"depth":132,"text":112},"how_to","\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-lower-aws-costs\u002Fcover.jpg","2020-12-19","The reality is simpler than you might think.","md","\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-lower-aws-costs\u002Ffeatured.jpg",{},"\u002Farticles\u002Fhow_to\u002F2020-12-19-how-to-lower-aws-costs","\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-lower-aws-costs\u002Fpreview.jpg",{"title":13,"description":141},"articles\u002Fhow_to\u002F2020-12-19-how-to-lower-aws-costs","Ue0NtBlwRuOJiKw-z6IjKYQzo5f_yZp9XtFJX9IxQ9M",{"id":151,"title":152,"author":14,"body":153,"category":138,"cover":430,"date":431,"description":432,"extension":142,"featured":433,"isFeatured":434,"meta":435,"navigation":8,"path":436,"preview":437,"seo":438,"stem":439,"__hash__":440},"articles\u002Farticles\u002Fhow_to\u002F2020-10-17-how-to-hire-the-technical-team.md","How to hire the technical team",{"type":16,"value":154,"toc":424},[155,161,165,168,171,174,177,181,185,188,192,195,198,202,205,209,212,215,218,221,224,227,230,233,237,306,310,313,321,324,328,354,358,400,404,414,417],[19,156,157,158,26],{},"This article is meant for CEOs, CTOs, and Managers. The goal is to give a better understanding of how to hire technical people by answering a common raised by clients: ",[23,159,160],{},"how can I hire technical people when I myself know nothing about the technology world",[28,162,164],{"id":163},"understanding-the-symptoms","Understanding the symptoms",[19,166,167],{},"The biggest difficulty when hiring technical people is when you don’t fully understand the skill you are hiring for and you can only try to gage their expertise with your gut feeling. You are stuck with your fingers crossed that the new hire will be as he presents himself.",[19,169,170],{},"This is an issue that very often comes up with clients that I work with. Normally, the symptoms look like this: the project starts fairly well, you see progress, and milestones are being achieved; but, after a few months, the project starts to slow down, seemingly simple things start to take months, and\u002For the new features are unstable.",[19,172,173],{},"At this point, even as a non-technical person, you start to realize that something is not right.",[19,175,176],{},"This type of scenarios is not due to the lack of knowledge of how to code (coding is easy) - the problem is in the lack of understanding that organized code is more important than simply knowing how to use a “if” statement. Or the DevOps people don't fully understand AWS, nor the best practices that they should follow to manage the whole infrastructure correctly, since AWS is not a SaaS solution like Heroku or others. AWS is the building blocks that allow you to build your own SaaS application. This key difference requires having a different mindset that not many know they have to get into, and so they manage AWS by hand, in one environment, and with minimal automation.",[28,178,180],{"id":179},"how-to-fix-the-existing-damage","How to fix the existing damage?",[60,182,184],{"id":183},"code","Code",[19,186,187],{},"When I come in to help, I do not try to understand the code, since normally the state of the code is in poor condition. There are no comments, no spaces, no new lines, and no formatting at all. I focus on reformatting the code to make it clean and simple to understand, then I do a second pass where I start to simplify some expressions, and after this stage all the mistakes that were impossible to figure out become obvious and stand out on their own.",[60,189,191],{"id":190},"infrastructure","Infrastructure",[19,193,194],{},"In this situation, we need to go over the idea of the project from scratch, understand what you want to build, and then start to make a diagram of the whole infrastructure based on what I think needs to be done. Then with the team we go over it to see if I missed something, where the team may have already encountered some limitation of the approach worth not repeating. We then finalize the diagram.",[19,196,197],{},"Once that is completed, I start making multiple CloudFormation files that describe the stack on AWS. This means that what was done will be scrapped and everything will be redone using CloudFormation files that will be deployed in three new environments: Development, Demo and Production - to keep everything organized.",[28,199,201],{"id":200},"how-to-start-with-the-right-team","How to start with the right team",[19,203,204],{},"If you have not yet start to put together a team, this section is for you. Here I want to give you a good frame of reference on how to look for technical people, while having little-to-no technical skills yourself. I believe that asking very technical questions does not allow you to find the best talent. For example, a law company won't ask a candidate if they memorized all the law books; they want to find out what type of person is in front of them. Just because you memorized paragraph 8 doesn't mean you are a good lawyer. The same analogy can be used in the technology world. Just because you know a \"if()\" statement or a function, doesn't make you a good developer - you just know how to code, and that is just a skill.",[60,206,208],{"id":207},"what-to-focus-on","What to focus on",[19,210,211],{},"You can’t ask direct questions where the answer is a Yes or No, because you will always get back what you want to hear. You have to give open ended questions that require the other side to think.",[19,213,214],{},"You want to look for people that can explain what they know and are able to share their experience easily, where you don’t have to pull information out of them. If you have the most genius person that doesn't know how to talk to others, and most importantly doesn't know how to explain technical things to non-technical people, then you'd get someone with very limited use. This person can only function with another technical person. In the beginning of your company, if they have to report to you, then you don't want someone like this on your team.",[19,216,217],{},"Another important thing is not to ask for cliché things like their education or years of experience, because this information is meaningless. One person can be very good after 2 years of learning the skill, while others will be mediocre even if they have 8 or 20 years of experience. If someone worked for 20 years in a big company, they can easily hide their mediocrity within the organization. And worst of all, they might not even know they are mediocre. Education is the same: you could have passed with the lowest grades and still got a diploma. If someone slept thought the whole university, they might know less then a passionate programmer who learned his craft in his free time.",[19,219,220],{},"Also, just because someone has been in the market for 20 years already, dose not mean they are good at it. You can infer that they just know the syntax of the specific language they claim to know; whereas the most important skills are the abilities to write clearly and to easily understand code, which are things that nobody teaches anyone. People that write hard to understand code will make your project eventually grind to a halt, and you will be held hostage by one programmer because he is the only one that knows what he did. Under no circumstance would you want to be held hostage by unnecessary complexity.",[19,222,223],{},"Writing working code is not a skill; it is a trait. The skill is to make it presentable to others.",[19,225,226],{},"Similarly with AWS. I have interviewd countless AWS “experts” who claim to know all that there is to know about AWS, yet when asked something more serious, they fail. As of writing this article, AWS has 170 services - just because an \"expert\" claimed to have used 3 of them doesn't mean they know how to use AWS. I have talked with a lot of candidates that claim they know AWS because they made and account and went over a simple tutorial on how to setup a Lambda. To them, this is the basic requirement to claim to know AWS.",[19,228,229],{},"A true AWS expert is someone that knows the ideology of the service, is able to mix and match all of this services to build a cost effective and extensible solution that can grow over time with the business, understands the pitfalls, knows how to get out of problems, and can figure out a new service within a week to combine it with the project if necessary. Not to mention they need to know how to automate everything in AWS, because nothing can be done by hand, as clicking things around with a mouse through the AWS console is something that can’t scale over time.",[19,231,232],{},"An expert also needs to understand what security is, how to provide only the required access to employees, and how to adhere to best practices to make it easier to pass compliance tests.",[28,234,236],{"id":235},"general-questions-for-all","General questions for all",[238,239,240,251,259,266,274,282,290,298],"ul",{},[241,242,243,247,250],"li",{},[244,245,246],"strong",{},"How do you keep your team leader up to date with the progress of the work?",[248,249],"br",{},"This is personal, so if you like the answer, all good.",[241,252,253,256,258],{},[244,254,255],{},"What do you do when you don’t know something?",[248,257],{},"What you want to hear is that they check the documentation, search Google, ask friends, then look for help with you.",[241,260,261,264,250],{},[244,262,263],{},"When there is nothing to do, what do you do?",[248,265],{},[241,267,268,271,273],{},[244,269,270],{},"Do you make your bed in the morning?",[248,272],{},"You want to hear a \"Yes\", this should tell you that they are more organized than most and don't give up easily.",[241,275,276,279,281],{},[244,277,278],{},"After how many years will you be done learning?",[248,280],{},"You want to hear \"never.\" This is the only acceptable answer and approach to life.",[241,283,284,287,289],{},[244,285,286],{},"Why did you get into the technology business?",[248,288],{},"If someone is in it just for the money, it might mean they don't have a mindset where they want to learn and get better.",[241,291,292,295,297],{},[244,293,294],{},"When someone tells you it can't be done, what do you do?",[248,296],{},"The answer should be: \"I don't accept no for an answer.\"",[241,299,300,303,305],{},[244,301,302],{},"How many times do you try before asking for help?",[248,304],{},"You want someone that knows after a while he needs to ask for help.",[60,307,309],{"id":308},"how-to-check-for-comprehension","How to check for comprehension",[19,311,312],{},"Write a few paragraphs describing 5 tasks to be completed but not broken down into sections or a list. Then tell them to brake down your description into steps and technologies that need to be used to accomplish the task. What they come up with should:",[238,314,315,318],{},[241,316,317],{},"Have all 5 things that need to be done.",[241,319,320],{},"Should be easy to understand by you. If something is unclear, ask for clarification and see if they can simplify the step further.",[19,322,323],{},"Unclear explanations by people only means that either they don’t understand the technology or the problem itself. Either is a serious red flag, because people will create very complex solutions that will be hard to extend over time.",[28,325,327],{"id":326},"specific-questions-for-developer","Specific questions for Developer",[238,329,330,338,346],{},[241,331,332,335,337],{},[244,333,334],{},"Do you have some open source projects on GitHub?",[248,336],{},"They should have something. This shows that they are passionate about programming and love it so much that they spend their free time learning new things on their own.",[241,339,340,343,345],{},[244,341,342],{},"Paste 100 lines of the code that you are most proud of.",[248,344],{},"Regardless of if you know how to code or not, you should look for clear comments that explain the story of the code. And the code itself should look visually simple. The more the code feels good to you, the better.",[241,347,348,351,353],{},[244,349,350],{},"What is more important, to use all the latest features of a language, or to keep the code as simple as possible?",[248,352],{},"You want to hear that they want to keep the code as simple as possible. Using the latest features of a language means that they will lose themselves in semantics, theories, ideologies, and ideas instead of focusing on the work that needs to be done. These types of people can be good scholars, but in a company when works needs to be done right, they will slow the project down and create endless discussions that go nowhere.",[28,355,357],{"id":356},"specific-questions-for-aws-experts","Specific questions for AWS Experts",[238,359,360,368,376,384,392],{},[241,361,362,365,367],{},[244,363,364],{},"How would you host a website with no servers on AWS that is SEO friendly?",[248,366],{},"You want to hear that the site will be built statically, hosted on S3, and delivered over CloudFront; while setting up a CodePipeline to build the site automatically when there is new code in the repository to build the static version of the site through CodeBuild.",[241,369,370,373,375],{},[244,371,372],{},"How many services have you used in your latest project?",[248,374],{},"You want to hear services that you think you'd like to use in your project. It is impossible to know them all, but you want to hear at least 2\u002F3 of what you need.",[241,377,378,381,383],{},[244,379,380],{},"How did you integrate them with each other?",[248,382],{},"This is a hard one because you can make a project hundreds of ways that will all work. But AWS is designed around the idea of Triggers, especially when you deal with the Serverless part of AWS. So you want to hear that they used triggers to pass messages to another service, which then triggered another one etc.",[241,385,386,389,391],{},[244,387,388],{},"How do you keep up to date with AWS?",[248,390],{},"You want to hear that they work on small private projects, check the AWS Blog daily, and watch videos regarding how others use AWS, in order to get ideas that can be implemented in another project.",[241,393,394,397,399],{},[244,395,396],{},"When would you use Server and when Serverless?",[248,398],{},"Any project that you start on AWS, you want to start with Serverless. This is an ideal approach because in the beginning you don't know how the project will pan out, and once it picks up steam, you want to convert the most used lambdas or other services in to a regular server to improve performance and reduce costs. This is the ideal road map.",[28,401,403],{"id":402},"unacceptable-excuses","Unacceptable excuses",[238,405,406],{},[241,407,408,411,413],{},[244,409,410],{},"\"I can’t share my code\" or \"I have signed an NDA.\"",[248,412],{},"A passionate developer should be proud to have one or 2 projects open for anyone to see.",[28,415,416],{"id":125},"To sum it up",[19,418,419,420,423],{},"You don't understand technical people because you lack the knowledge they have, or you don't understand them because they can't explain their work in simpler terms. The technicality is their expertise and knowledge they acquired over time, which is something that you don't have to have. But they must be able to not make you feel stupid or question your intelligence. Knowledge is ",[23,421,422],{},"not"," intelligence.",{"title":131,"searchDepth":132,"depth":132,"links":425},[426,427,428,429],{"id":183,"depth":132,"text":184},{"id":190,"depth":132,"text":191},{"id":207,"depth":132,"text":208},{"id":308,"depth":132,"text":309},"\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-hire-the-technical-team\u002Fcover.jpg","2020-10-17","how can I hire technical people when I myself know nothing about the technology world?","\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-hire-the-technical-team\u002Ffeatured.jpg",false,{},"\u002Farticles\u002Fhow_to\u002F2020-10-17-how-to-hire-the-technical-team","\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-hire-the-technical-team\u002Fpreview.jpg",{"title":152,"description":432},"articles\u002Fhow_to\u002F2020-10-17-how-to-hire-the-technical-team","h9c6vuD_yc_rjW34IauQptvB6Rivhw8tM05U1PLDUtY",{"id":442,"title":443,"author":14,"body":444,"category":138,"cover":1201,"date":1202,"description":1203,"extension":142,"featured":1204,"isFeatured":434,"meta":1205,"navigation":8,"path":1206,"preview":1207,"seo":1208,"stem":1209,"__hash__":1210},"articles\u002Farticles\u002Fhow_to\u002F2020-08-11-how-to-understand-dynamodb.md","How to understand DynamoDB",{"type":16,"value":445,"toc":1187},[446,449,453,456,460,463,467,470,474,477,489,492,496,499,504,507,636,639,642,834,837,848,851,858,862,865,1031,1034,1037,1041,1044,1050,1053,1070,1088,1091,1094,1111,1114,1131,1134,1145,1148,1151,1155,1163,1167,1178,1180,1183],[19,447,448],{},"This article is meant for anyone who wants to better understand DynamoDB after experiencing an AWS bill for DDB is too high, the complexity is too big, or the promised speed is not there. This article answers a straightforward question: Am I using DynamoDB the right way?",[60,450,452],{"id":451},"why-im-not-getting-dynamodb","Why I'm not getting DynamoDB",[19,454,455],{},"You may be surprised, but 20+ years of SQL may not help you with this new AWS service, and the biggest reason is that you are probably comparing DynamoDB to MongoDB. Both are NoSQL but still are very different from one another. For example, just because you store data as JSON and there are no columns for a fixed structure that you have to set upfront doesn't mean they are the same.",[60,457,459],{"id":458},"mongodb-is-self-hosted-and-this-is-a-problem","MongoDB is self-hosted, and this is a problem",[19,461,462],{},"Because you can host MongoDB, it makes it hard for you to realize the incorrectness in the ongoing data structure. Doing it wrong doesn't appear to cost you anything because you don't have limits, and you pay just for the server that MongoDB runs on. If the performance is an issue, you can always add a bigger server, and all the mistakes get hidden away.",[60,464,466],{"id":465},"dynamodb-is-the-real-nosql-database","DynamoDB is the real NoSQL Database",[19,468,469],{},"Since AWS hosts DynamoDB for you, you are forced to adhere to the NoSQL principles, which makes you pay for all your mistakes out of your pocket, and the only way around it is to understand NoSQL.",[60,471,473],{"id":472},"dynamodb-key-limits","DynamoDB Key Limits",[19,475,476],{},"DynamoDB has three significant limits:",[478,479,480,483,486],"ol",{},[241,481,482],{},"Pay per request",[241,484,485],{},"Pay for each byte that goes in and out",[241,487,488],{},"One record can't be bigger than 400Kb",[19,490,491],{},"These three rules make it so that you either structure the data the right way or lose the performance and could have to pay thousands of dollars for simple requests.",[60,493,495],{"id":494},"examples","Examples",[19,497,498],{},"I'll give you two examples that should give you a good idea of how to start thinking about DDB data structure and organize your website to make sure that all work well together.",[500,501,503],"h3",{"id":502},"user-data","User Data",[19,505,506],{},"A typical case of user data would be the name, email, address, and a JSON object that could look like this:",[508,509,513],"pre",{"className":510,"code":511,"language":512,"meta":131,"style":131},"language-JSON shiki shiki-themes github-light github-dark","{\n    \"name\": \"0x4447\",\n    \"email\": \"hello@0x4447.email\",\n    \"address\": {\n        \"street\": \"10 Springflied St.\",\n        \"city\": \"Springflied\",\n        \"state\": \"Springflied\",\n        \"country\": \"USA\",\n        \"postal\": \"01100\"\n    }\n}\n\n","JSON",[183,514,515,524,540,553,562,575,588,600,613,624,630],{"__ignoreMap":131},[516,517,520],"span",{"class":518,"line":519},"line",1,[516,521,523],{"class":522},"sVt8B","{\n",[516,525,526,530,533,537],{"class":518,"line":132},[516,527,529],{"class":528},"sj4cs","    \"name\"",[516,531,532],{"class":522},": ",[516,534,536],{"class":535},"sZZnC","\"0x4447\"",[516,538,539],{"class":522},",\n",[516,541,543,546,548,551],{"class":518,"line":542},3,[516,544,545],{"class":528},"    \"email\"",[516,547,532],{"class":522},[516,549,550],{"class":535},"\"hello@0x4447.email\"",[516,552,539],{"class":522},[516,554,556,559],{"class":518,"line":555},4,[516,557,558],{"class":528},"    \"address\"",[516,560,561],{"class":522},": {\n",[516,563,565,568,570,573],{"class":518,"line":564},5,[516,566,567],{"class":528},"        \"street\"",[516,569,532],{"class":522},[516,571,572],{"class":535},"\"10 Springflied St.\"",[516,574,539],{"class":522},[516,576,578,581,583,586],{"class":518,"line":577},6,[516,579,580],{"class":528},"        \"city\"",[516,582,532],{"class":522},[516,584,585],{"class":535},"\"Springflied\"",[516,587,539],{"class":522},[516,589,591,594,596,598],{"class":518,"line":590},7,[516,592,593],{"class":528},"        \"state\"",[516,595,532],{"class":522},[516,597,585],{"class":535},[516,599,539],{"class":522},[516,601,603,606,608,611],{"class":518,"line":602},8,[516,604,605],{"class":528},"        \"country\"",[516,607,532],{"class":522},[516,609,610],{"class":535},"\"USA\"",[516,612,539],{"class":522},[516,614,616,619,621],{"class":518,"line":615},9,[516,617,618],{"class":528},"        \"postal\"",[516,620,532],{"class":522},[516,622,623],{"class":535},"\"01100\"\n",[516,625,627],{"class":518,"line":626},10,[516,628,629],{"class":522},"    }\n",[516,631,633],{"class":518,"line":632},11,[516,634,635],{"class":522},"}\n",[19,637,638],{},"The gut instinct is to save this whole object into DDB and call it a day. But this is not the right way of doing it. The reason: you pay per bytes sent and received. In a typical situation, you will display the user's name more than the email and then display the address from time to time. But if you save everything, you'd pay for the whole payload each time, even though you only want to get the name. This approach is slower since you have to send more data, and you end up paying for the whole payload, despite just needing the name.",[19,640,641],{},"A better way of saving this data is to split it into three different objects:",[508,643,645],{"className":510,"code":644,"language":512,"meta":131,"style":131},"{\n    \"id\": \"001\",\n    \"type\": \"user#basic\",\n    \"name\": \"0x4447\"\n}\n\n{\n    \"id\": \"001\",\n    \"type\": \"user#basic#email\",\n    \"email\": \"hello@0x4447.email\"\n}\n\n{\n    \"id\": \"001\",\n    \"type\": \"user#basic#address\",\n    \"address\": {\n        \"street\": \"10 Springflied St.\",\n        \"city\": \"Springflied\",\n        \"state\": \"Springflied\",\n        \"country\": \"USA\",\n        \"postal\": \"01100\"\n    }\n}\n\n",[183,646,647,651,663,675,684,688,693,697,707,718,727,731,736,741,752,764,771,782,793,804,815,824,829],{"__ignoreMap":131},[516,648,649],{"class":518,"line":519},[516,650,523],{"class":522},[516,652,653,656,658,661],{"class":518,"line":132},[516,654,655],{"class":528},"    \"id\"",[516,657,532],{"class":522},[516,659,660],{"class":535},"\"001\"",[516,662,539],{"class":522},[516,664,665,668,670,673],{"class":518,"line":542},[516,666,667],{"class":528},"    \"type\"",[516,669,532],{"class":522},[516,671,672],{"class":535},"\"user#basic\"",[516,674,539],{"class":522},[516,676,677,679,681],{"class":518,"line":555},[516,678,529],{"class":528},[516,680,532],{"class":522},[516,682,683],{"class":535},"\"0x4447\"\n",[516,685,686],{"class":518,"line":564},[516,687,635],{"class":522},[516,689,690],{"class":518,"line":577},[516,691,692],{"emptyLinePlaceholder":8},"\n",[516,694,695],{"class":518,"line":590},[516,696,523],{"class":522},[516,698,699,701,703,705],{"class":518,"line":602},[516,700,655],{"class":528},[516,702,532],{"class":522},[516,704,660],{"class":535},[516,706,539],{"class":522},[516,708,709,711,713,716],{"class":518,"line":615},[516,710,667],{"class":528},[516,712,532],{"class":522},[516,714,715],{"class":535},"\"user#basic#email\"",[516,717,539],{"class":522},[516,719,720,722,724],{"class":518,"line":626},[516,721,545],{"class":528},[516,723,532],{"class":522},[516,725,726],{"class":535},"\"hello@0x4447.email\"\n",[516,728,729],{"class":518,"line":632},[516,730,635],{"class":522},[516,732,734],{"class":518,"line":733},12,[516,735,692],{"emptyLinePlaceholder":8},[516,737,739],{"class":518,"line":738},13,[516,740,523],{"class":522},[516,742,744,746,748,750],{"class":518,"line":743},14,[516,745,655],{"class":528},[516,747,532],{"class":522},[516,749,660],{"class":535},[516,751,539],{"class":522},[516,753,755,757,759,762],{"class":518,"line":754},15,[516,756,667],{"class":528},[516,758,532],{"class":522},[516,760,761],{"class":535},"\"user#basic#address\"",[516,763,539],{"class":522},[516,765,767,769],{"class":518,"line":766},16,[516,768,558],{"class":528},[516,770,561],{"class":522},[516,772,774,776,778,780],{"class":518,"line":773},17,[516,775,567],{"class":528},[516,777,532],{"class":522},[516,779,572],{"class":535},[516,781,539],{"class":522},[516,783,785,787,789,791],{"class":518,"line":784},18,[516,786,580],{"class":528},[516,788,532],{"class":522},[516,790,585],{"class":535},[516,792,539],{"class":522},[516,794,796,798,800,802],{"class":518,"line":795},19,[516,797,593],{"class":528},[516,799,532],{"class":522},[516,801,585],{"class":535},[516,803,539],{"class":522},[516,805,807,809,811,813],{"class":518,"line":806},20,[516,808,605],{"class":528},[516,810,532],{"class":522},[516,812,610],{"class":535},[516,814,539],{"class":522},[516,816,818,820,822],{"class":518,"line":817},21,[516,819,618],{"class":528},[516,821,532],{"class":522},[516,823,623],{"class":535},[516,825,827],{"class":518,"line":826},22,[516,828,629],{"class":522},[516,830,832],{"class":518,"line":831},23,[516,833,635],{"class":522},[19,835,836],{},"This way, you get only what you need because you have three separate pages for each piece of information. For example:",[238,838,839,842,845],{},[241,840,841],{},"User Identity",[241,843,844],{},"Email",[241,846,847],{},"Address",[19,849,850],{},"When the user visits this individual page, you will get only what the page requires.",[19,852,853,854,857],{},"Later in this article, I will write more about the ",[183,855,856],{},"type"," key.",[60,859,861],{"id":860},"invoice-data","Invoice Data",[19,863,864],{},"The following example looks at the 400Kb limit per object. The clients I work with always end up with this data structure: they use the Array type object, add Invoice data in this array, and then save the whole thing as one object in DynamoDB. For example:",[508,866,868],{"className":510,"code":867,"language":512,"meta":131,"style":131},"{\n    \"id\": \"001\",\n    \"type\": \"user#invoices\",\n    \"invocie\": [\n        {\n            \"id\": \"001\",\n            \"price\": \"$99\",\n            \"payed\": true\n        },\n        {\n            \"id\": \"002\",\n            \"price\": \"$99\",\n            \"payed\": true\n        },\n        {\n            \"id\": \"003\",\n            \"price\": \"$99\",\n            \"payed\": false\n        }\n    ]\n}\n\n",[183,869,870,874,884,895,903,908,919,931,941,946,950,961,971,979,983,987,998,1008,1017,1022,1027],{"__ignoreMap":131},[516,871,872],{"class":518,"line":519},[516,873,523],{"class":522},[516,875,876,878,880,882],{"class":518,"line":132},[516,877,655],{"class":528},[516,879,532],{"class":522},[516,881,660],{"class":535},[516,883,539],{"class":522},[516,885,886,888,890,893],{"class":518,"line":542},[516,887,667],{"class":528},[516,889,532],{"class":522},[516,891,892],{"class":535},"\"user#invoices\"",[516,894,539],{"class":522},[516,896,897,900],{"class":518,"line":555},[516,898,899],{"class":528},"    \"invocie\"",[516,901,902],{"class":522},": [\n",[516,904,905],{"class":518,"line":564},[516,906,907],{"class":522},"        {\n",[516,909,910,913,915,917],{"class":518,"line":577},[516,911,912],{"class":528},"            \"id\"",[516,914,532],{"class":522},[516,916,660],{"class":535},[516,918,539],{"class":522},[516,920,921,924,926,929],{"class":518,"line":590},[516,922,923],{"class":528},"            \"price\"",[516,925,532],{"class":522},[516,927,928],{"class":535},"\"$99\"",[516,930,539],{"class":522},[516,932,933,936,938],{"class":518,"line":602},[516,934,935],{"class":528},"            \"payed\"",[516,937,532],{"class":522},[516,939,940],{"class":528},"true\n",[516,942,943],{"class":518,"line":615},[516,944,945],{"class":522},"        },\n",[516,947,948],{"class":518,"line":626},[516,949,907],{"class":522},[516,951,952,954,956,959],{"class":518,"line":632},[516,953,912],{"class":528},[516,955,532],{"class":522},[516,957,958],{"class":535},"\"002\"",[516,960,539],{"class":522},[516,962,963,965,967,969],{"class":518,"line":733},[516,964,923],{"class":528},[516,966,532],{"class":522},[516,968,928],{"class":535},[516,970,539],{"class":522},[516,972,973,975,977],{"class":518,"line":738},[516,974,935],{"class":528},[516,976,532],{"class":522},[516,978,940],{"class":528},[516,980,981],{"class":518,"line":743},[516,982,945],{"class":522},[516,984,985],{"class":518,"line":754},[516,986,907],{"class":522},[516,988,989,991,993,996],{"class":518,"line":766},[516,990,912],{"class":528},[516,992,532],{"class":522},[516,994,995],{"class":535},"\"003\"",[516,997,539],{"class":522},[516,999,1000,1002,1004,1006],{"class":518,"line":773},[516,1001,923],{"class":528},[516,1003,532],{"class":522},[516,1005,928],{"class":535},[516,1007,539],{"class":522},[516,1009,1010,1012,1014],{"class":518,"line":784},[516,1011,935],{"class":528},[516,1013,532],{"class":522},[516,1015,1016],{"class":528},"false\n",[516,1018,1019],{"class":518,"line":795},[516,1020,1021],{"class":522},"        }\n",[516,1023,1024],{"class":518,"line":806},[516,1025,1026],{"class":522},"    ]\n",[516,1028,1029],{"class":518,"line":817},[516,1030,635],{"class":522},[19,1032,1033],{},"User data from the example above is somewhat limited. In the invoice example, we will hopefully increase the object size each month for the product's lifespan. But at some point, you will go over the 400Kb limit per object. What then? Developers often come up with crazy solutions to split the object to go around this limit. Unfortunately, doing so adds a considerable amount of complexity. The performance also drops drastically since you have to get back 400Kb of data every time, plus you are not taking advantage of partitioning.",[19,1035,1036],{},"There is a more straightforward solution that will allow you to never have to think about this limit ever again and add incredible flexibility to your data which will dramatically increase the performance and speed.",[60,1038,1040],{"id":1039},"always-add-a-search-key","Always add a Search Key",[19,1042,1043],{},"The Search Key is your friend, and you should always use it. There are edge cases where you don't have to use it, but these are edge cases, and over time, you'll know when not to use it. Right now, we will focus on 99.99% of cases.",[19,1045,1046,1047],{},"The search key needs to be understood as a file path, the same file path on your computer. For example: ",[183,1048,1049],{},"\u002Ffolder_name\u002Ffolder_name\u002Ffile_name.extension",[19,1051,1052],{},"You have to create the search key using the same logic. For example, if we take the user data example, we could have:",[238,1054,1055,1060,1065],{},[241,1056,1057],{},[183,1058,1059],{},"user#basic",[241,1061,1062],{},[183,1063,1064],{},"user#basic#email",[241,1066,1067],{},[183,1068,1069],{},"user#basic#address",[19,1071,1072,1073,1076,1077,1080,1081,1084,1085,1087],{},"With a structure like this, you can use DynamoDB's query function and the filter ",[183,1074,1075],{},"start_with",". With these two things, you can get everything that you need in one go by stating that you want everything that starts with ",[183,1078,1079],{},"user#basic#"," or, to be more precise, with a regular ",[183,1082,1083],{},"get"," request, in order to only get ",[183,1086,1069],{}," for the page that just shows the address.",[19,1089,1090],{},"You still have the flexibility to get a big chunk of information when needed, but you also get all the granularity you need most of the time.",[19,1092,1093],{},"The same rule applies to the invoices because you can have a search key like this:",[238,1095,1096,1101,1106],{},[241,1097,1098],{},[183,1099,1100],{},"user#invoice#nr1",[241,1102,1103],{},[183,1104,1105],{},"user#invoice#nr2",[241,1107,1108],{},[183,1109,1110],{},"user#invoice#nr3",[19,1112,1113],{},"And you can keep all your data in separate records, where 400Kb is plenty. But you also can go one step further and do this:",[238,1115,1116,1121,1126],{},[241,1117,1118],{},[183,1119,1120],{},"user#invoice#2020#nr1",[241,1122,1123],{},[183,1124,1125],{},"user#invoice#2020#nr2",[241,1127,1128],{},[183,1129,1130],{},"user#invoice#2020#nr3",[19,1132,1133],{},"This way, you can make a query that returns:",[238,1135,1136,1139,1142],{},[241,1137,1138],{},"just one invoice",[241,1140,1141],{},"the whole year's worth of invoices",[241,1143,1144],{},"or everything together.",[19,1146,1147],{},"As you can see, this is your limitless array of data that can go into infinity. No need to worry about the 400Kb limit, not to mention that working with arrays in DynamoDB is complex and wasteful.",[19,1149,1150],{},"To update an entry in the array, you need to know the position of that item (index), which means that if you don't know it, then you have to download the whole object, loop over every entry in the array, find the position, update it, and then send back the whole object again. So if you have an object of 400Kb, you then have to send back an additional 400Kb, which is 800Kb in total. So, again, a slow and expensive operation to change one item in an array.",[60,1152,1154],{"id":1153},"never-do-this-with-dynamodb","Never do this with DynamoDB",[238,1156,1157,1160],{},[241,1158,1159],{},"Never make one big object",[241,1161,1162],{},"Never use Arrays unless the data you are working with has them, and you need to store it as is.",[60,1164,1166],{"id":1165},"always-do-this-with-dynamodb","Always do this with DynamoDB",[238,1168,1169,1172,1175],{},[241,1170,1171],{},"Brake down your data in the smallest parts you can",[241,1173,1174],{},"Design your search key as folder structure",[241,1176,1177],{},"Always make precise queries to get what you need.",[60,1179,416],{"id":125},[19,1181,1182],{},"I hope this explanation will give you a much better understanding of how to go about working with DynamoDB, and I genuinely hope this will bring your costs down and speed improvements.",[1184,1185,1186],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":131,"searchDepth":132,"depth":132,"links":1188},[1189,1190,1191,1192,1193,1196,1197,1198,1199,1200],{"id":451,"depth":132,"text":452},{"id":458,"depth":132,"text":459},{"id":465,"depth":132,"text":466},{"id":472,"depth":132,"text":473},{"id":494,"depth":132,"text":495,"children":1194},[1195],{"id":502,"depth":542,"text":503},{"id":860,"depth":132,"text":861},{"id":1039,"depth":132,"text":1040},{"id":1153,"depth":132,"text":1154},{"id":1165,"depth":132,"text":1166},{"id":125,"depth":132,"text":416},"\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-understand-dynamodb\u002Fcover.jpg","2020-08-11","Am I doing DynamoDB the right way?","\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-understand-dynamodb\u002Ffeatured.jpg",{},"\u002Farticles\u002Fhow_to\u002F2020-08-11-how-to-understand-dynamodb","\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-understand-dynamodb\u002Fpreview.jpg",{"title":443,"description":1203},"articles\u002Fhow_to\u002F2020-08-11-how-to-understand-dynamodb","rAkIITqguB5LCqpL2CB5JpcuWL9DhJWtVMpbP6MqJWg",{"id":1212,"title":1213,"author":14,"body":1214,"category":138,"cover":1294,"date":1295,"description":1221,"extension":142,"featured":1296,"isFeatured":434,"meta":1297,"navigation":8,"path":1298,"preview":1299,"seo":1300,"stem":1301,"__hash__":1302},"articles\u002Farticles\u002Fhow_to\u002F2020-07-17-how-to-organize-a-project-with-cloudformation.md","How to organize a project with CloudFormation",{"type":16,"value":1215,"toc":1287},[1216,1222,1226,1229,1232,1236,1239,1243,1246,1266,1269,1272,1276,1279,1282,1284],[19,1217,1218,1219],{},"This article is meant for CEOs, CTOs, and Managers. The goal is to give you a better understanding of how to organize a project with CloudFormation, by answering a common question clients have: ",[23,1220,1221],{},"How should a project be broken down to keep it flexible?",[60,1223,1225],{"id":1224},"dont-paint-yourself-in-to-a-corner","Don't paint yourself in to a corner",[19,1227,1228],{},"CloudFormation files are powerful, will simplify your life, and are easy to be reused in other projects. In this article where I describe the beefiest of CloudFormation files.",[19,1230,1231],{},"It is important to understand how to separate the files in to smaller stacks. Putting your whole project in to one big file will make your life harder, not to mention there is a limit of 200 services per file.",[60,1233,1235],{"id":1234},"harder-how","Harder how?",[19,1237,1238],{},"AWS will follow the instructions in the CloudFormation file and will add, update, or remove services at your command. But sometimes you can encounter a situation where you can't create an update because there is a dependency that is blocking the resources that you want to update. A common problem is, for example, renaming a service or removing a service that another service is relying on. And, since the two series are linked together by an ARN in some situations, AWS won't update that ARN and you will be stuck.",[60,1240,1242],{"id":1241},"the-solution","The solution",[19,1244,1245],{},"The key is to keep the CloudFormation files separate for each category of your project. For example, this is a default breakdown that I do for clients:",[238,1247,1248,1251,1254,1257,1260,1263],{},[241,1249,1250],{},"Database",[241,1252,1253],{},"Compute",[241,1255,1256],{},"Cedentials",[241,1258,1259],{},"SMTP",[241,1261,1262],{},"Notification",[241,1264,1265],{},"etc.",[19,1267,1268],{},"In the Database CloudFormation file, I might have RDS, DynamoDB, and also S3. If I'm taking advantage of the triggering system that DynamoDB and S3 provides, then I paste the ARN of the Lambdas from the Compute CloudFormation file. Since it is impossible right now deploy a stack that has the triggering service and the triggered one, since, for example, S3 depends on the existence of a Lambda to get the ARN to be triggered, and the Lambda permission depends on the S3 existing to get the ARN for the policy.",[19,1270,1271],{},"The solution is to keep these two parts separate to allow yourself maximum flexibility while also keeping things organized in a logical way.",[60,1273,1275],{"id":1274},"easier-to-manage-and-control","Easier to manage and control",[19,1277,1278],{},"This way of braking down the project into separate CF files makes it also easier to manage, because you can have an expert for each project. For example, if your project gets big enough, you can have a Database expert that manages and has only access to the Database stack. Same for a Serverless expert, and maybe one person that can handle 3 smaller stacks at the same time.",[19,1280,1281],{},"This way everyone only has access to what they are responsible for.",[60,1283,416],{"id":125},[19,1285,1286],{},"I hope this article helped you to get an idea how a project should be structured with multiple CloudFormation files, and of course you are not limited to the examples provided above. You are free to brake your project down in anyway that makes sense to you, but regardless of how you do, one big file is never the way to go, since the goal is to have the project grow over time.",{"title":131,"searchDepth":132,"depth":132,"links":1288},[1289,1290,1291,1292,1293],{"id":1224,"depth":132,"text":1225},{"id":1234,"depth":132,"text":1235},{"id":1241,"depth":132,"text":1242},{"id":1274,"depth":132,"text":1275},{"id":125,"depth":132,"text":416},"\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-organize-a-project-with-cloudformation\u002Fcover.jpg","2020-07-17","\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-organize-a-project-with-cloudformation\u002Ffeatured.jpg",{},"\u002Farticles\u002Fhow_to\u002F2020-07-17-how-to-organize-a-project-with-cloudformation","\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-organize-a-project-with-cloudformation\u002Fpreview.jpg",{"title":1213,"description":1221},"articles\u002Fhow_to\u002F2020-07-17-how-to-organize-a-project-with-cloudformation","1Mkls91SIKHkqCVRI8oVdgXU5JyK9b-47SBn_-WpYL0",{"id":1304,"title":1305,"author":14,"body":1306,"category":138,"cover":1430,"date":1431,"description":1432,"extension":142,"featured":1433,"isFeatured":434,"meta":1434,"navigation":8,"path":1435,"preview":1436,"seo":1437,"stem":1438,"__hash__":1439},"articles\u002Farticles\u002Fhow_to\u002F2020-03-15-how-to-lower-ec2-costs.md","How to lower EC2 Costs",{"type":16,"value":1307,"toc":1425},[1308,1314,1318,1321,1325,1330,1333,1337,1340,1378,1381,1384,1388,1391,1395,1398,1402,1405,1408,1411,1414,1417,1420,1422],[19,1309,1310,1311],{},"This article is meant for CEOs, CTOs, and Managers. The goal is lowering your AWS costs by 40 or even 75 percent within a few minutes (depending on the instance type and plan), by answering a common question clients have: ",[23,1312,1313],{},"What options do I have at my disposal to lower the AWS bill?",[60,1315,1317],{"id":1316},"what-are-reserved-instances","What are Reserved Instances?",[19,1319,1320],{},"If you pay for an instance upfront for a period of either one or three years, then your price for an instance can be 40 to 75 percent lower. The beauty of this is that if you buy a Reserved Instance, you don't have to make changes to your instances - no restart or reconfiguration is necessary. This is because a Reserved Instance is a billing concept. If you have two instances and you buy one Reserved Instance, AWS will automatically apply the discount for the instance that matches the type you bought. The entire process is seamless for you.",[60,1322,1324],{"id":1323},"what-else-should-i-know","What else should I know?",[1326,1327,1329],"h4",{"id":1328},"standard-vs-convertible","Standard vs. Convertible",[19,1331,1332],{},"There are two types of Reserved Instances: Standard and Convertible. Standard is suitable for a situation when you have an organized environment and you know what you need. Convertible (a bit more  expensive) is for situations with a more dynamic environment that requires constant changes to your operating systems and instance families as well as types.",[1326,1334,1336],{"id":1335},"normalization-factor","Normalization Factor",[19,1338,1339],{},"AWS gives you quite a bit of flexibility with the Normalization Factor approach. Each instance type has the following factors:",[238,1341,1342,1345,1348,1351,1354,1357,1360,1363,1366,1369,1372,1375],{},[241,1343,1344],{},"nano: 0.25",[241,1346,1347],{},"micro: 0.5",[241,1349,1350],{},"small: 1",[241,1352,1353],{},"medium: 2",[241,1355,1356],{},"large: 4",[241,1358,1359],{},"xlarge: 8",[241,1361,1362],{},"2xlarge: 16",[241,1364,1365],{},"4xlarge: 32",[241,1367,1368],{},"8xlarge: 64",[241,1370,1371],{},"10xlarge: 80",[241,1373,1374],{},"16xlarge: 128",[241,1376,1377],{},"32xlarge: 256",[19,1379,1380],{},"This means that if you buy one large type, you can actually have four small instance types, or two small ones and four nano types. You can mix this as long as the total factor number matches the size of what you bought.",[19,1382,1383],{},"AWS also allows you to scale above what you have. For example, let's say you bought a large type for the year and you scaled up to the 2xlarge type for one week. AWS will charge you the On-Demand price, but only for the scaling factor that goes beyond what you paid for. They do the calculation automatically so you don't have to worry about it.",[1326,1385,1387],{"id":1386},"be-organized","Be organized",[19,1389,1390],{},"The Scaling Factor is flexible, but best practice is to have a homogeneous instance type. This makes it much easier to manage and keeps costs to a minimum.",[1326,1392,1394],{"id":1393},"you-can-resell-what-you-dont-use","You can resell what you don't use",[19,1396,1397],{},"If you buy a one-year or three-year lease, and after some time you find that you don't need it anymore, or you've upgraded to a new type because of traffic to your site, then you can buy the new type and put the old lease on the market for bidding. While you won't be able to get 100 percent of the money back from the remainder of your old type, you'll still get a decent amount.",[1326,1399,1401],{"id":1400},"the-roll-over-strategy","The roll-over strategy",[19,1403,1404],{},"Even with the flexibility AWS gives you, you may still be left with some unused instance types. Before you resell them, you should consider the following strategy: roll your instance types to the next-lower traffic site. For example, let's assume that you have a site with two parts, the front end and the back end. The back is the API, and the front delivers the site build using Angular, with some server rendering for good SEO.",[19,1406,1407],{},"Both projects run using a load balancer, and each LB has a minimum of two instances of type t3.small. You buy one type, a t3.large server, for one year and pay 100 percent upfront. You then use the Normalization Factor to fragment the one large into four small types.",[19,1409,1410],{},"Six months later you get so much traffic that you have to upgrade the back end to a larger type. In this case, you could change the instance type by buying a one-year lease for a large type and split that into two mediums.",[19,1412,1413],{},"Now you have two units to spare. You could add two more small (or one medium) instance types to your front end to handle the additional traffic.",[19,1415,1416],{},"The reasoning here is that more traffic will increase the load on both projects, but the front end will have the smallest load, and that can be handled by four small server types.",[19,1418,1419],{},"When the lease for the old types expires, you can switch the front end to two bigger server types or extend the lease for what you already have. AWS's flexibility means you have options to role-over instance types and save money.",[60,1421,416],{"id":125},[19,1423,1424],{},"Stop using On-Demand servers for long-term work. Use them only for quick tests, maintenance, or temporary auto scaling to handle spikes in traffic during the day. For continuous work, use Reserved Instances, and spend your money elsewhere.",{"title":131,"searchDepth":132,"depth":132,"links":1426},[1427,1428,1429],{"id":1316,"depth":132,"text":1317},{"id":1323,"depth":132,"text":1324},{"id":125,"depth":132,"text":416},"\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-lower-ec2-costs\u002Fcover.jpg","2020-03-15","Lower your AWS costs by 40 or even 75 percent within a few minutes (depending on the instance type and plan).","\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-lower-ec2-costs\u002Ffeatured.jpg",{},"\u002Farticles\u002Fhow_to\u002F2020-03-15-how-to-lower-ec2-costs","\u002Fpublic\u002Fimg\u002Farticles\u002Fhow-to-lower-ec2-costs\u002Fpreview.jpg",{"title":1305,"description":1432},"articles\u002Fhow_to\u002F2020-03-15-how-to-lower-ec2-costs","aAnsTuXM2SDP4gTx6kv3lblrRphQ_0j4cl7ZIfoHeLA",1783756520354]