TECH |
Engadget Japanese |
HUAWEI P50 Pro発表。200倍ズームカメラ搭載のフラッグシップ スマホ |
https://japanese.engadget.com/huawei-p-50-pro-143034969.html
|
huaweippro |
2021-07-29 14:30:34 |
TECH |
Engadget Japanese |
モトローラ edge 20シリーズを海外発表 144Hzディスプレイでヌルサク |
https://japanese.engadget.com/motorala-edge-20-series-140043593.html
|
発表 |
2021-07-29 14:00:43 |
Google |
カグア!Google Analytics 活用塾:事例や使い方 |
ヘッドホンハンガーおすすめ9本 |
https://www.kagua.biz/review/interior/20210729b2.html
|
ヘッドホン |
2021-07-29 14:59:05 |
AWS |
AWS Compute Blog |
Building a serverless multiplayer game that scales: Part 2 |
https://aws.amazon.com/blogs/compute/building-a-serverless-multiplayer-game-that-scales-part-2/
|
Building a serverless multiplayer game that scales Part This post shows how you can add scaling support for a game via automation The example uses Amazon Rekognition to check images for unacceptable content and uses asynchronous architecture patterns with Step Functions and HTTP WebPush |
2021-07-29 14:26:33 |
AWS |
AWS Cloud Enterprise Strategy Blog |
Stats Perform Is Innovating by Working Backwards with AWS |
https://aws.amazon.com/blogs/enterprise-strategy/stats-perform-is-innovating-by-working-backwards-with-aws/
|
Stats Perform Is Innovating by Working Backwards with AWSGood inventors and designers deeply understand their customer They spend tremendous energy developing that intuition They study and understand many anecdotes rather than only the averages you ll find on surveys But you the product or service owner must understand the customer have a vision and love the offering A remarkable customer experience starts with heart … |
2021-07-29 14:28:15 |
AWS |
AWS Open Source Blog |
Deploying to Amazon Managed Workflows for Apache Airflow with CI/CD tools |
https://aws.amazon.com/blogs/opensource/deploying-to-amazon-managed-workflows-for-apache-airflow-with-ci-cd-tools/
|
Deploying to Amazon Managed Workflows for Apache Airflow with CI CD toolsApache Airflow s active open source community familiar Python development as directed acyclic graph DAG workflows and extensive library of pre built integrations have helped it become a leading tool for data scientists and engineers for creating data pipelines Amazon Managed Workflows for Apache Airflow Amazon MWAA is a fully managed service that makes running open source … |
2021-07-29 14:26:28 |
Google |
Official Google Blog |
Helping site owners manage consent in AdSense |
http://feedproxy.google.com/~r/blogspot/MKuf/~3/S11Okeh0KJw/
|
Helping site owners manage consent in AdSensePrivacy regulations like the European General Data Protection Regulation GDPR and the California Consumer Privacy Act CCPA are an important part of privacy first advertising But navigating privacy regulations can be complex if you can t dedicate resources to meet the varying regulatory requirements across the globe The process of consent management often entails Notifying site visitors on how their data is being usedEnabling site visitors to provide consent or manage their data preferencesCommunicating those preferences to advertising partners so that they re respectedTo help you gather and manage user consent for GDPR and opt out requests for CCPA we ve launched new consent management features directly in AdSense Auto ads These features offer an easy way for you to communicate with your site visitors providing them an opportunity to manage their data and privacy preferences This also gives you the ability to gather consent for advertising purposes so you can continue to grow advertising revenue and fund your content Gather and manage consent for GDPRAdSense s consent management solution is integrated with the Interactive Advertising Bureau IAB Europe s Transparency and Consent Framework TCF v which standardizes the process and offers common language for gathering consent under the GDPR and ePrivacy Directive When an EEA or U K user visits your site from those regions your GDPR consent message will display to give them options to manage their data and their choices will be automatically respected by AdSense and communicated to your advertising partners Gather opt out requests for CCPAAdSense also supports the IAB s CCPA Compliance Framework which provides you with a standardized approach to manage opt outs from users in this state AdSense Auto ads detects when a user from California visits your site shows them a CCPA opt out message ensures their choice will be automatically respected by AdSense and makes the user s choices available to other advertising partners you ve integrated on the page Grow revenue in a privacy focused wayAdSense makes the process of gathering and managing consent easy It allows you to communicate with your users and give them more transparency and control over how their data is being used This makes it possible for you to continue to fund your content with advertising in a privacy first way The consent management solutions in AdSense are simple for publishers to use As they re already integrated into AdSense Auto ads simply edit your site s Auto ads settings click “More features and then turn on your consent messages Of course this feature is optional to use and you can work with any consent management platform of your choice As new privacy regulations arise we ll continue to evolve our consent management solutions to help partners navigate user privacy decisions in a transparent way We remain committed to helping site owners earn money through their content and grow their digital businesses for the future in a privacy first ecosystem Watch this space for further updates in the coming months Please visit the AdSense help center to learn more |
2021-07-29 15:00:00 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
PythonでETロボコンシミュレータ(大会用)を動かしてみた。 |
https://qiita.com/YoshitakaAtarashi/items/2adc57f6e30d6a6d47fd
|
mrubyは実機でも動作することを意識し、TOPPERS、Athrillの環境をベースにしているため、これはこれでとても興味深い環境だと思っています。 |
2021-07-29 23:41:54 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Pythonライブラリを使用したグラフ作成色々 |
https://qiita.com/horigo/items/3b1b7cb8bc0e954627a0
|
一番上の行でグラフの並べ方と数を指定しているので、ここをいじると横に並べたりつのグラフを×で配置したりできます。 |
2021-07-29 23:21:47 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Django Settings.pyについて |
https://qiita.com/Yuki-max/items/e3a329a4cf3fddbfd6eb
|
settingspyについてsettingspyBASEDIRPathfileresolveparentparentHTMLファイルなどのパスを指定するときに基準として用いられる。 |
2021-07-29 23:18:54 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Pythonのstatsmodelsで時系列データをトレンド、季節性、残差に分解する |
https://qiita.com/shinji_komine/items/9dbada69b9128f645660
|
ある時点iの移動平均を求めるとき、この時点iの前後から周期個のデータを含めて平均する必要があります。 |
2021-07-29 23:09:05 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
スプレッドシートのIMPORTXMLのコマンドでプルダウンからの取得ができない |
https://teratail.com/questions/351905?rss=all
|
|
2021-07-29 23:52:42 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
【pandas】列に浮動小数点を含むDataFrame同士の比較方法 |
https://teratail.com/questions/351904?rss=all
|
【pandas】列に浮動小数点を含むDataFrame同士の比較方法pandasのDataFrameを戻り値とする関数をテストする中で、期待値として用意したDataFrameと、出力値のDataFrameの比較結果が一致しません。 |
2021-07-29 23:27:01 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
stripe payment linksでメールアドレスを再利用したい。 |
https://teratail.com/questions/351903?rss=all
|
stripepaymentlinksでメールアドレスを再利用したい。 |
2021-07-29 23:24:36 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
RailsとNginxの連携ができない |
https://teratail.com/questions/351902?rss=all
|
RailsとNginxの連携ができない前提・実現したいことNginxをリバースプロキシとして使用し、RailsのAPサーバであるPumaにUNIXドメイン連携したい。 |
2021-07-29 23:19:42 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
polygonを書くプログラミングでエラーが発生してしまう。 |
https://teratail.com/questions/351901?rss=all
|
polygonを書くプログラミングでエラーが発生してしまう。 |
2021-07-29 23:16:25 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
[Rails]基本的なエラーを知ろう |
https://qiita.com/mkato1013/items/74ed504d51e3f91e81c1
|
コントローラーにメソッドが定義されていた場合は、コントローラアクションに関連したデータベース上のテーブルカラムを確認する。 |
2021-07-29 23:34:10 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
[Rails]基本的なエラーを知ろう |
https://qiita.com/mkato1013/items/74ed504d51e3f91e81c1
|
コントローラーにメソッドが定義されていた場合は、コントローラアクションに関連したデータベース上のテーブルカラムを確認する。 |
2021-07-29 23:34:10 |
海外TECH |
DEV Community |
Images are hard. Is there an simpler, more pragmatic approach? |
https://dev.to/robole/images-are-hard-is-there-an-simpler-more-pragmatic-approach-chl
|
Images are hard Is there an simpler more pragmatic approach Recently I was asked if I would be interested in writing an article about responsive images by an editor The editor was looking for specific advice for experienced developers about the topic I said no because I think giving cut and dry advice on a topic like this is difficult and it can easily be misleading if you try to distill it down too much You need cover the ground properly so an article series would be more suitable There is a part series by Jason Grigsby from called Responsive Images which provided a thorough tutorial on responsive images but now it is dated in some respects Also Jason wrote an article in called Guidelines and Rule for Responsive Images that gives more practical advice I haven t seen a worthy up to date predecessor to these articles Even MDN s guide to responsive images defers to Jason s article on background images and media queries Putting images on the web is not just about making them responsive there are other considerations Also there are changes in this space which have led to some people to christen today as the beginning of the new responsive era It s early days on that so I wouldn t get carried away What I would say is that things are convoluted now and we should be looking for a simpler way There isn t a good set of guidelines for dealing with images in a holistic manner If you know of any let me know Today I d like to discuss some of these issues and provide some of that missing guidance Where doth the difficulty lie There are a lot of different considerations with images You bump into a heap of questions when you re using images such as What s the difference between the image formats Which should I use and when What is the browser support like now How do I load images in the most performant manner Should I preload some images Should I use lazy loading everywhere Do I need to use JavaScript for lazy loading What about that new content visibility property What about optimization What sizes do I use How do I automate the process Addy Osmani wrote a whole book on image optimization recently What should I do to make images accessible Do I use an alt attribute on all images What do I do with background images Can I make them responsive Chris Coyier also discussed this topic in his recent article Images are hard and said Putting images on websites is incredibly simple yes Actually yes it is You use lt img gt and link it to a valid source in the src attribute and you re done Except that there are counts fingers things you could and some you really should do that often go overlooked Chris goes on to list approximately of these things There are some bits that come to my mind also that Chris did not mention I m not going to make a complete list It s too much It makes me sad that things are like this There have been improvements in some areas better tooling is available to cover some of it but some of it is impractical I imagine it would feel overwhelming for someone who wants to build a website who is not a web developer but would like to or a beginner who wants to do things the right way We should reassure people that it is OK to just use an lt img gt with one appropriately sized image when you are starting out Your website will work fine You are breaking no laws You can learn more and improve on this later As I discuss later many of us are pretty loose with how we use images anyway so he who has not sinned should cast the first stone In particular I say this because it seems to me that that there is more pressure to make everything fast now Web performance is being hyped up People are talking more about Lighthouse scores The marketing guys are linking improvements in performance to revenue gains And there is the spectre of SEO reaper lurking SEO rankings are inexplicably being linked to performance now through Google s core web vital metrics But but I just want to build a small fan site for BTS Maybe that s why some people prefer to build discord bots instead of websites now For me there isn t a cohesive and clear message on how to do things well It s an accumulation of stuff that is not synthesized I think it s important to look at what people are actually doing rather than what people are saying or suggesting to cut through the rhetoric Rereading Jason s article on guidelines from he says No one knows what the future of responsive images holds A few years from now we will probably look back on the hacks we re using and laugh at our naivety What do you think I m still waiting for holographic personal devices How are images really used on the webLet s look at the Web Almanac to see what is really happening The Web Almanac is an annual report which combines the raw stats and trends of the HTTP Archive with the expertise of the web community Let s look at last year s report with regard to images and performance In the median page weighted approximately MB for desktop and MB for mobile and a shocking MB for desktop and MB for mobile at the th percentile The median page weight contains approxmiately MB of images and approxmiately KB of JavaScript This is why people point at images as the lowest hanging fruit for reducing page weight Images are still the most requested type of resource though JavaScript is closing in The thing is it s not just the size of the resources It s the amount of requested resources This is the distribution of requests by content type The numbers seem bonkers to me It is common to have images on page The number of requests on desktop for the media page is the same as last year yet the page weight has increased by KB Pages are getting bigger In terms of performance it is hard to summarise This is the most succinct summary directly from the report On the surface we have seen optimistic signals about the new Core Web Vitals performance metrics At least half of the experiences are good across both desktop and mobile devices if we don t narrow down to consistently poor experiences on slower networks for Largest Contentful Paint While the newer metrics might suggest that there s an ongoing uptake in addressing performance issues the lack of significant improvements in First Contentful Paint and Time to First Byte is sobering Here the same network types are most disadvantaged as with Largest Contentful Paint as well as fast connections and desktop devices The Performance Score also portrays a decline in speed or perhaps a more accurate portrayal than what we measured in the past What the data shows us is that we must keep investing in improving performance for scenarios such as slower connectivity that we often don t experience due to multiple aspects of our privilege middle to high income countries high pay and new capable devices It also highlights that there s still plenty of work to be done in the areas of speeding up initial paints LCP and FCP and asset delivery TTFB Let s just say there is room for improvement What would you recommend Ship less images Don t serve images for your average webpage Show restraint be selective This made me think of this quote from Dickens Subdue your appetites my dears and you ve conquered human nature Pasting SVG icons into your HTML will reduce the amount of requests In the age of static site generators and web components it is easier to do this in one place and avoid duplication Pick the maximum image size for your page and work back from there For example if you have a blog and the maximum width of your blog post is px then serve images with a maximum width of px This will cover high resolution screens with x pixel density Jake Archibald mentions this as the lazy way in his article Halve the size of images by optimising for high density displays For a beginner I would suggest sticking with a single image format with lt img gt You don t need to learn a static site generator or JavaScript to get started making websites but it will make it easier in the longer run Use JPEG for photos and use either a PNG or SVG preferably for more graphical images such as icons and diagrams Maybe next year you can start using WEBP instead of JPEG and PNG At the moment WEBP is only partially supported in Safari If I follow this recommendation for this page I use images in the article totaling KB I ran images through squooshto reduce their size That s already good Define the dimensions of images through the width and height attributes or the aspect ratio property This will prevent parts of your page moving around when an image loads This is called cumulative layout shift CLS and is one of Google s core web vitals metrics I prefer to use aspect ratio but it has only just made it to safari So now it is in all major browsers but keep this in mind if browser support is an issue for you If you want to learn more about the ins and outs of this you can read the article Setting Height And Width On Images Is Important Again It s a min read yowzer For any images below the fold by below the fold I mean any image that would not be seen when the page is loaded you can lazy load these images This will defer loading of images that are off screen until the user scrolls near them You can do this by adding this attribute loading lazy to lt img gt This attribute is supported in of browsers now but looking at the most recent data Jan Jun on the HTTP Archive it is used by just of websites If I add lazy loading to this page only the main image is loaded which is KB images in the page header are always loaded i e the logo I would recommend that you learn the basics of SVG Using SVG instead of PNG is an easy win Since SVG is a text based vector format files can be very small The main image for this article is a SVG and is KB SVGs can scale up and down without any loss of quality Effectively you can have image that looks good on any screen By Yug et al from Wikimedia Commons CC BY SA If you do these simple things you will probably be ahead of the median website Test your website in your favourite audting tool such as Webpagetest or Lighthouse to see where you re at After that you are getting into more technical territory The next biggest win is to optimize images You can choose to do it yourself or use an use an Image CDN If you have a small website a manual process would be fine Just find a GUI app or command line tool whatever you are comfortable with one that will give do bulk resizing and optimization of your images for you You just want to point to a folder and have it spit out all of the alternative versions for you You can add the markup to your page yourself albeit this is a bit tedious If you are using different image formats you need to use lt picture gt instead of lt img gt If you use a static site generator or a backend platform like Wordpress there are some integrated options such as There is Eleventy Image which is made for Eleventy but can be used outside of Eleventy also Nuxt related to Vue has nuxt image Gatsby related to React has gatsby plugin image Wordpress has plugins such as Jetpack To use these plugins some JavaScript may be required You could muddle through with Eleventy Image without knowing that much JavaScript It only makes sense to venture into Nuxt if you already know Vue and Gatsby if you already know React It s just to demonstrate that this is something that platform frameworks are treating as an important concern now which is good I would think you re in very good state if you have done this much Of course there are other optimizations you can do Test your website out and see if more is necessary Finally look at what browsers you need to support to see if you need to polyfill the loading attribute And that s the shortest version I could manage What about background images Background images are specified in CSS with background image For now it s probably best to stick with media queries if you want to swap out background images for different screen resolutions There is image set which can take multiple resolutions of an image and let the browser make the best decision about which one to use It is not quite ready for prime time yet there are caveats If you want to explore this further you can read this article Using Performant Next Gen Images in CSS with image set What about the new responsive era I don t know I haven t looked into yet I prefer to focus on now ConclusionThis was meant to be a quick article I hope I shed some light on a few bits and bobs with regard to images on the web I just wanted to share some observations and point out some of the simple steps you take to make using images easier We should try to be more pragmatic Building websites shouldnt feel like spinning plates Happy coding Image AttributionThe featured distribution graphs are courtesy of the HTTPArchive with rights reserved under a Apache License |
2021-07-29 14:52:11 |
海外TECH |
DEV Community |
The 4 Day Work Week |
https://dev.to/mikhailkaran/the-4-day-work-week-2bfo
|
The Day Work Week What is HTML All The ThingsHTML All The Things is a web development podcast and discord community which was started by Matt and Mike developers based in Ontario Canada The podcast speaks to web development topics as well as running a small business self employment and time management You can join them for both their successes and their struggles as they try to manage expanding their Web Development business without stretching themselves too thin What s This One About In this episode Matt and Mike sit down with Derek Duncan to discuss his company s recent move to a day work week After the interview the duo sit down to discuss the matter further putting their own ideas and opinions together with Derek s first hand insight The day work week has been a topic of much discussion lately giving workers days off to get a proper rest after a hard week s work Some argue that it is not possible to get days of productivity while others maintain that it is possible as the extra day off makes the workers more productive all week Guest IntroductionDerek Duncan joins us on the podcast today to give his insight on how the company that he co founded Instinct Science transitioned to a day workweek Apply for a Job at Instinct Science Show Notes Derek Duncan Why did your company decide to go to a day work week How did your current employees react to the decision How do you cover periods of time when most people are gone Was there an adjustment period if so how long and how difficult How intense is a normal workday Did productivity go up or down How has it affected hiring for you easier to hire a better developer Will the excitement of days wear off Did you keep salaries the same or were they reduced feel free to cross this one out if you don t feel comfortable answering Post interview Matt s take on work schedules Increased productivity A more equal workplace Better employee engagement Matt s take on the day workweek Async work Mike s take on the day workweek Key TakeawaysYour leadership needs to make adjustments and be able to adapt for the day work week to be successful It s possible to cut down a day and increase productivity by allowing employees to recover will lead to more deep work hours ResourcesYou can find us on all the podcast platforms out there as well asInstagram htmlallthethings Twitter htmleverything TikTok Html All The Things |
2021-07-29 14:37:58 |
海外TECH |
DEV Community |
PHP __destruct (🧙♂️Lesson 2: PHP Magic Methods) |
https://dev.to/cleancodestudio/php-destuct-lesson-2-php-magic-methods-111i
|
PHP destruct ️Lesson PHP Magic Methods PHP destruct Magic Method methodDuring Lesson One of our Php Magic Methods Tutorial we learned about the infamous construct Php Magic Method What s the opposite of construction Destruction Dive in with me as we learn how to property utilize the PHP destruct magic method in the second lesson of our PHP Magic Methods series To use the destruct magic method we simply add the destruct magic method as a public function on our class In the example below our constructor accepts the lady and gentleman in our constructor The constructor is called when our object in instantiated or constructed The destructor magic method on the other hand is the exact opposite The destruct PHP magic method is going to be executed when the object is destroyed using unset as shown below or when the PHP run time is complete lt phpclass Home public lady public gentleman public function construct lady gentleman this gt lady lady this gt gentleman gentleman echo Welcome Home this gt lady amp this gt gentleman n n public function destruct echo You ll about to die this gt lady amp this gt gentleman guess it was a simulation after all n home new Home Sarah Tom lake house new Home Spicy Senorita Surfer Cali Dude unset home destroying or obliterating application ends and then lake house destructor will executeOutput Welcome Home Sarah amp Tom You ll about to die Sarah and Tom guess it was a simulation after all What if we use the sleep function to pause our runtime for seconds before we call the unset function to destroy our object lt phpclass Home public lady public gentleman public function construct lady gentleman this gt lady lady this gt gentleman gentleman echo Welcome Home this gt lady amp this gt gentleman n n public function destruct echo You ll about to die this gt lady amp this gt gentleman guess it was a simulation after all n home new Home Sarah Tom lake house new Home Spicy Senorita Surfer Cali Dude sleep unset home destroying or obliterating application ends and then lake house destructor will executeOutputWelcome Home Sarah and Tom second pauseOutputYou ll about die Sarah and Tom guess it was a simulation after allIf we removed the unset function all together then the destruct magic method is run when the PHP runtime is complete ltag user id follow action button background color d important color ffffff important border color d important Clean Code StudioFollow Clean Code StudioClean Code Clean Life Simplify PHP destruct magic method |
2021-07-29 14:25:08 |
海外TECH |
DEV Community |
One big reason to review the code |
https://dev.to/viezly/one-big-reason-to-review-the-code-5hf6
|
One big reason to review the codeCode review has been there for a while But many people struggle to explain why they are doing it in the first place It s like a default action that is required for mystical good code quality Yes it s fairly simple to justify to yourself or other people why you and your team need code review But often these reasons don t really have solid proof of effectiveness Or just doesn t work when a team doesn t meet even their standards of code review quality and involvement I m going to talk about one real and universal reason why you personally should review the code of your teammates Also I ll share a small example and a study related to this reason Why do people review code in general Let s enlist common reasons to review code changes These are Check security issuesImplementation checkArchitectural reviewCode style reviewPerformance reviewErrors and bugs and mistakes catchingMaintainability changeabilityKnowledge sharingAll of these reasons aimed to mitigate future issues Improving code quality helps the application to run with fewer bugs and performance issues And better code quality brings joy for developers ーgood code easier to read and maintain So these reasons mostly aimed for better code review That s great But what in the code review for you personally The last line in the list is knowledge sharing Usually this means senior devs help less experienced folks write better code But what about just reading The ultimate reason to review the codeWell reviewing teammates code makes you more familiar with the codebase And thus making you more satisfied with the code quality Apparently how people perceive the code quality is not only measured by the complexity of this code but also by how people are familiar with the code Familiarity plays a big role in our acceptance of the code Devs who review code more often tend to evaluate their codebase more quality than those who review less A team might have several similar codebases in terms of code quality But perceive the code which they simply didn t work very often as bad code Studies and examplesYou can watch an interesting story about code familiarity and code quality perception The speaker tells a story about the team which has several codebases The team evaluate one codebase as good and another as bad But after code complexity analysis turns out that the codebases are pretty similar code in terms of quality and complexity But the good code is the code on which the team worked daily and the bad code is the code they inherited from another team in the organization and thus have no familiarity with it Also as mentioned in this research devs who are satisfied with code review and perform it more often usually more satisfied with their codebase And those who are satisfied with the code review process tend to do code review more often than those who didn t Code review is better for you And you don t need to go deep into the code So the reason for you to read code is at least to track changes and index codebase It s not necessary to dig into the details of each especially when the codebase is enormous But reading to have at least the idea of code structure can improve your feeling about the whole codebase It s a great way to not be sad about code quality in the future |
2021-07-29 14:08:20 |
海外TECH |
DEV Community |
The What, Why, and When of Mono-Lambda vs Single Function APIs |
https://dev.to/aws-builders/the-what-why-and-when-of-mono-lambda-vs-single-function-apis-5cig
|
The What Why and When of Mono Lambda vs Single Function APIsAlmost once per week I see a question on Twitter StackOverflow or Reddit about how to structure Serverless APIs Like most things in software the tl dr is it depends If you re bored already just skim the TL DR and tweet at me with your objections If not get ready to dive in TL DRSingle Function APIs More control granularity over settings and IAM execution roleEasy to find logs log groupsSmaller package sizeHighest optionality to use API Keys highly customized authorizers rate limiting etc Easier development as functions are isolatedNeed to pay attention to CF stack limitLong deploy timesMore complexity in configuration vs code Much harder to share code between REST functionsMono Lambda APIs Super flexible with routingBring your own framework like ExpressLess concern about CF stack limitsVery easy to share code between routes resourcesLess overall optionality need to set authorizer for all functions and handle RBAC in code Combined development experience need good CI processesLarger package sizeMore complexity debugging as all actions route to one log streamLess granular IAM permissions Detailed comparisonBut our goal is to take a deep look at these options their technical consequences and the factors which may help you make a decision so it depends won t suffice Lambda is frankly a pretty boring part of Serverless Boring in a good way like a healthy DevOps culture where deploys are frequent painless and well boring If you re coming from a traditional background of reverse proxies and servers you ve used some kind of domain based or top level route based routing of requests and then usually something like Rails or Express which matches individual routes to business logic Serverless APIs sit behind some kind of load balancer as well Analyzing API Gateway REST API HTTP API and Application Load Balancer ALB is a topic for another post so I ll skip it After choosing an API provider you ve got two choices when integrating Lambda You can create individual paths and route those requests to individual Lambda functions Single Function or you can route all requests to one function and then inside your function use a routing system like express to route paths to business logic Mono Lambda Single function APIThe Single Function API pattern fits Lambda very naturally It s very easy to add a new function to the serverless yml file declare a new handler and you re done In the world of Single Function APIs there are two additional options You can have a separate function for each action on a resource GET LIST PUT POST and DELETE This keeps code compartmentalized and small You could group all resources under a single function and then have a case statement depending on the HTTP method and URL parameters passed This is a bit more complicated but might make sense for you if you ve got a large number of resources and don t want to run up against stack resource limits or long running deploys Single functions offer a few key advantages A single function has the highest available level of granularity for settings such as Maximum and or provisioned concurrencyFunction timeoutsRequest bodiesQuery string formattingIAM execution rolePerhaps the most important item on the list is the IAM policy that your lambda function executes under In a Single Function API each function can be restricted to exclusively its action For example if I had an individual function for an update user API I can restrict the IAM role to only update calls to DynamoDB which would guarantee my update function could never delete a record Single functions are often much easier to debug as each log stream only contains data for individual actions on a resource When compared to a Mono Lambda where all API resources and actions are combined in a log stream it s much easier to troubleshoot Single Function APIs You can also greatly reduce your overall package size and footprint with package individually trueThis can help improve cold start times but any gain here is likely offset by the distribution of web requests across several functions DO NOT choose either API pattern based on the perceived risk of cold starts as they are rare getting rarer short getting shorter and easily mitigated via other measures Finally a Single Function API fits the general design narrative that AWS has for Lambda based APIs This means you ll generally encounter less friction and have the most flexibility when using API based rate limiting API keys authorizers and more Single function API design has several downsides too Cloudformation deploys slow down as more resources are added and each Lambda function requires several resources beyond just the function like the execution role and log group There is also a resource limit for each Cloudformation stack If you have a separate function and role and group for each route for each resource you can very quickly run into this limit Finally sharing code across many lambda functions can be a difficult endeavor Lambda layers are great but they re explicitly versioned and require a second parallel CI CD process to deploy This means if you want to update some shared code say request response payload formatter or common utility functions you ve got to publish a new version of the layer and then update its usage in EVERY function which again can take a long time Examplefunctions getUser handler users get events httpApi path users id method GET listUsers handler users list events httpApi path users method GET createUser handler users create events httpApi path users method POST updateUser handler users update events httpApi path users id method PUT deleteUser handler users delete events httpApi path users id method DELETE Mono Lambda APIThe Mono Lambda design has a few key advantages It s more natural for folks coming from traditional backgrounds with Rails or Express In fact you can drop your express API into Lambda pretty easily although I don t recommend it as Express adds a fair bit of overhead Mono Lambda APIs are also much simpler to consider from a release and deployment standpoint This might be the biggest selling point of a Mono Lambda API because to me the most important aspect of a software team is its ability to deploy software as frequently as possible I oftentimes find folks with extremely complicated release processes for Single Function APIs caused by hundreds of Lambda functions and multiple shared libraries via layers or private packages If your organization doesn t have the resources to devote towards enabling shared code to be deployed and released to Single Function APIs quickly and safely a Mono Lambda is a good choice The uniform configuration of a Mono Lambda API can be a blessing or a curse If your problem domain encompasses numerous resources with similar actions and behaviors and you re using a single table DynamoDB pattern the IAM policy for each resource is probably very similar This means you can generate a reasonably strict policy which still allows the Mono Lambda API to perform necessary operations without being over permissive With a Mono Lambda API you ll be doing things like routing request format validation access control and throttling inside of your Lambda function This is fine for many people as Express Koa etc all have robust libraries you can use and developers are likely already familiar with how to do this If you re not using the advanced features of API Gateway it makes a lot of sense to consider a Mono Lambda API If you don t care about those advanced API Gateway features or losing granularity on IAM concurrency timeout settings the biggest downside of a Mono Lambda API is that the AWS console and Cloudwatch can be a bit of a mess to work with By default logs for the entire function go to one stream Since your function processes different resources it can be hard to trace I suggest writing highly structured log messages using a custom logger and then relying on Cloudwatch log insights to filter That can be slow and there are a ton of rd party options to help manage this Full disclosure I work at one So explore your options and try many of them Examplefunctions app handler index handler events httpApi path ANY proxy method ANY Closing thoughtsMono Lambda vs Single Function isn t a hard and fast choice but rather a spectrum with most users trying a combination of both in the long term I think a Mono Lambda is a great default choice and since it s easy to split out Serverless functions down the line it s not a one way choice When I find a use case for highly specific permissions want to use an API gateway feature like API Keys or require a single responsibility Lambda function then I ll use one Good luck out there Feel free to reach out on twitter with specific questions or to share something you re building |
2021-07-29 14:04:18 |
Apple |
AppleInsider - Frontpage News |
UK NHS app updated with Apple Wallet support for COVID Pass |
https://appleinsider.com/articles/21/07/29/uk-nhs-app-updated-with-apple-pay-support-for-covid-pass?utm_medium=rss
|
UK NHS app updated with Apple Wallet support for COVID PassSeparately from its controversial coronavirus contact tracing project the U K has updated its regular NHS app to effectively become a vaccination passport UK COVID Pass in Apple WalletWales and England s famously poor million NHS COVID app is currently under criticism for sending almost self isolation alerts in the week of July Now known locally as the pingdemic these alerts have become so numerous that the UK government has cut back on its advice about self isolating Read more |
2021-07-29 14:55:53 |
Apple |
AppleInsider - Frontpage News |
A war for the sighted is brewing in Apple's season two trailer for 'See' |
https://appleinsider.com/articles/21/07/29/a-war-for-the-sighted-is-brewing-in-apples-season-two-trailer-for-see?utm_medium=rss
|
A war for the sighted is brewing in Apple x s season two trailer for x See x A new trailer for critically acclaimed Apple TV show See picks up right after the events of season one as Baba Voss must face his past and begin the fight for those who can see See season two premieres on August Dave Bautista joins the cast as the brother of Baba Voss Jason Mamoa in this post apocalyptic drama The latest trailer shows a war is brewing around those who can see and the potential of using sight as a weapon Read more |
2021-07-29 14:40:54 |
Apple |
AppleInsider - Frontpage News |
Apple Pay now offered for eBay purchases made on desktop |
https://appleinsider.com/articles/21/07/29/apple-pay-now-offered-for-ebay-purchases-made-on-desktop?utm_medium=rss
|
Apple Pay now offered for eBay purchases made on desktopOnline retailer and auction site eBay has rolled out support for Apple Pay on its desktop website Yet another major retailer has added support for Apple Pay on their desktop site Those visiting eBay can now use Apple Pay to check out when using Safari Support for Apple Pay has already existed in eBay s mobile apps for a significant period of time but the move to support Apple Pay on desktop seems to be new Users who use their Apple Card for eBay purchases will receive cashback as part of the Apple Card rewards program Read more |
2021-07-29 14:56:33 |
海外TECH |
Engadget |
Huawei’s P50 lineup is powered by HarmonyOS 2 but lacks 5G |
https://www.engadget.com/huawei-p50-pro-smartphones-harmony-os-2-snapdragon-888-144502211.html?src=rss
|
Huawei s P lineup is powered by HarmonyOS but lacks GHuawei has revealed the P and P Pro its first flagship phones that use HarmonyOS from the outset The company started rolling out the operating system to its existing devices in early June The switch to HarmonyOS was made in part due to US sanctions that have hit Huawei Along with slowing down manufacturing and hobbling the company s ability to source components with American technology the restrictions led to Google shutting off Huawei from official Android updates Huawei switched to an open source version It was also prevented from using Google apps and services on its most recent phones There have been suggestions that HarmonyOS is actually a fork of open source Android The sanctions also seem to have impacted Huawei s choice of processor in the latest handsets too The P and one of the P Pro variants boast Qualcomm s Snapdragon G chipset with Adreno graphics Qualcomm received permission in November to sell some chips to Huawei The other models use Huawei s own Kirin processor but there s no mention of G support for any of the devices Pick from the Cocoa Gold Charm Pink Golden Black and Pearl White colourways amp see your vision brought to life with the HUAWEIPSeries Have a look for yourself LiveSmartWithHuaweipic twitter com xJkTVhtnーHuawei Mobile HuaweiMobile July The P and P Pro which are aimed at the Chinese market boast inch and inch displays with Hz and Hz refresh rates respectively Both devices use the same hole punch front facing MP camera The P Pro s rear camera array includes MP color and MP mono True Chroma lenses a MP ultra wide and a MP telephoto camera The P has a MP True Chroma camera a MP ultra wide and a MP telephoto lens The devices are IP rated for their splash water and dust resistance The phones both support W super fast wired charging and the P Pro offers W wireless charging The P has a mAh battery while the P Pro has a mAh capacity The P starts at yuan approximately for a model with GB of RAM and GB of storage It ll be available in September The P Pro meanwhile will be available broadly on August th starting at yuan about for the same memory and storage capacity as the base P Huawei hasn t clarified if or when it ll sell the devices outside of China |
2021-07-29 14:45:02 |
海外科学 |
NYT > Science |
Steven Weinberg, Groundbreaking Nobelist in Physics, Dies at 88 |
https://www.nytimes.com/2021/07/25/science/steven-weinberg-groundbreaking-nobelist-in-physics-dies-at-88.html
|
Steven Weinberg Groundbreaking Nobelist in Physics Dies at His discoveries deepened understanding of the basic forces at play in the universe and he took general readers back to its dawn in his book “The First Three Minutes |
2021-07-29 14:44:05 |
金融 |
RSS FILE - 日本証券業協会 |
株券等貸借取引状況(週間) |
https://www.jsda.or.jp/shiryoshitsu/toukei/kabu-taiw/index.html
|
貸借 |
2021-07-29 15:30:00 |
ニュース |
BBC News - Home |
Van-Tam says jabs have prevented 60,000 Covid deaths |
https://www.bbc.co.uk/news/newsbeat-58014546
|
covid |
2021-07-29 14:47:09 |
ニュース |
BBC News - Home |
Doctor Who: Jodie Whittaker and Chris Chibnall to leave in 2022 |
https://www.bbc.co.uk/news/entertainment-arts-57940451
|
drama |
2021-07-29 14:00:52 |
ニュース |
BBC News - Home |
In pictures: International Tiger Day 2021 |
https://www.bbc.co.uk/news/in-pictures-58012200
|
annual |
2021-07-29 14:12:55 |
ニュース |
BBC News - Home |
Erasmus records hour-long video demanding 'equal chance' from Lions Test officials |
https://www.bbc.co.uk/sport/rugby-union/58012090
|
Erasmus records hour long video demanding x equal chance x from Lions Test officialsSouth Africa boss Rassie Erasmus records an hour long video monologue railing against the refereeing in his side s first Test defeat by the British and Irish Lions |
2021-07-29 14:24:13 |
北海道 |
北海道新聞 |
NY株、一時最高値 緩和縮小の警戒和らぐ |
https://www.hokkaido-np.co.jp/article/572728/
|
警戒 |
2021-07-29 23:19:00 |
北海道 |
北海道新聞 |
前回覇者の韓国、白星発進 野球・29日 |
https://www.hokkaido-np.co.jp/article/572722/
|
北京五輪 |
2021-07-29 23:09:00 |
仮想通貨 |
BITPRESS(ビットプレス) |
[CoinChoice] 中国人民銀行がデジタル人民元(e-CNY)発行の意義を強調する白書公表 |
https://bitpress.jp/count2/3_9_12675
|
coinchoice |
2021-07-29 23:40:55 |
コメント
コメントを投稿