Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.


Sign Up

Articles related to "request"


System Design Interview Prep: Should You Put the Data in Cache?

  • In many cases, cache are blocks of memory that store data.
  • So, it is not practical to store everything in the cache if your application needs to deal with a large volume of data.
  • For example, if your system needs to update or write data frequently, data in cache would need to be constantly changing too.
  • Therefore, the application needs to mark the data in cache as invalid.
  • The advantage is that write is faster because there is no need to update backing data store.
  • In this scenario, when a new request comes, and there’s cache miss, we will need to evict a block for the new data.
  • It increases throughput and decreases latency by putting a relatively small amount of hot data in the memory so that data access can avoid hitting the disk.

save | comments | report | share on


System Design Interview Prep: Should You Put the Data in Cache?

  • In many cases, cache are blocks of memory that store data.
  • So, it is not practical to store everything in the cache if your application needs to deal with a large volume of data.
  • For example, if your system needs to update or write data frequently, data in cache would need to be constantly changing too.
  • Therefore, the application needs to mark the data in cache as invalid.
  • The advantage is that write is faster because there is no need to update backing data store.
  • In this scenario, when a new request comes, and there’s cache miss, we will need to evict a block for the new data.
  • It increases throughput and decreases latency by putting a relatively small amount of hot data in the memory so that data access can avoid hitting the disk.

save | comments | report | share on


Make your CSS production-ready by creating a build process

  • Let's now write some scripts in package.json that'll execute our process.
  • It's only if you write in Sass, you need this step otherwise skip it.🏂 This will just compile your sass code to browser readable css.
  • This is the command with which your css is going to have vendor prefixes like -webkit-, -moz, -ms- and -o-, which otherwise you'd have to add manually.
  • Vendor prefixing is a way for browser makers to add support for new CSS features before those features are fully supported in all browsers.
  • How and why you would want to use CSS vendor prefixes in your website?
  • P.S.: You can choose to output the compressed css into another css file, like style.min.css which is alright, but you'll then need to add a link tag to your HTML to include this.

save | comments | report | share on


How to build a conference line with Twilio and Ruby

  • In this post we'll build a conference line that anyone can join using Twilio and Ruby on Rails.
  • The conference line will require one controller with an action that will respond to an incoming webhook from Twilio when someone calls your Twilio number.
  • We will respond to the request with TwiML to tell Twilio to send the caller into a conference call.
  • Instead, check out this post on how to protect webhook endpoints in Ruby applications by validating the request signature using Rack middleware.
  • Run the application again and make a POST request to http://localhost:3000/calls.You will see the TwiML returned as XML.
  • Open up the Twilio console and navigate to the phone number you want to use for this conference line.

save | comments | report | share on


Progressive Bundling

  • Until recently, the use of JavaScript modules required a build step to make them run in the browser.
  • What this means is we no longer require a build step to be able to write modular code that runs in the browser natively.
  • This pattern uses a cloud function to optimize the amount of JavaScript sent to the browser by bundling together modules and their sub-modules, into a single request, on-demand.
  • The request is then redirected with a 302 status code to the newly bundled, fingerprinted, and cached file.
  • What makes this progressive is that you can start with stock JavaScript for development, which is easier to debug, then layer on bundling with a cloud function, and a standard HTTP redirect for an optimized build if you ever need it.
  • It is possible to cut down on requests, but end-up loading too large a file that ultimately negatively impacts performance.

save | comments | report | share on


API Testing : The Definitive Guide in 2020

  • The first constraint of the REST API states that the Client and server has to communicate and agree to certain rules based on resources(they should communicate with same resource like json, xml, html , txt) and with proper encoding like UTF-8 extra.
  • APIs in REST is stateless and Client and server don’t worry about the state of the request or response.
  • It is a messaging protocol that allows programs that run on disparate operating systems or services like frontend or backend to communicate using Hypertext Transfer Protocol (HTTP) and its Extensible Markup Language (XML).
  • It is an API Testing tool used by developers and Testers to perform API Testing with lots of different features like Global variables, mock request, Environment and monitoring of APIs. You can learn more about a postman in my full Video lecture series here.

save | comments | report | share on


Spring Security: Authentication and Authorization In-Depth

  • You can use this guide to understand what Spring Security is and how its core features like authentication, authorization or common exploit protection work.
  • At its core, Spring Security is really just a bunch of servlet filters that help you add authentication and authorization to your web application.
  • Think back to my other article, where we found out that basically any Spring web application is just one servlet: Spring’s good old DispatcherServlet, that redirects incoming HTTP requests (e.g. from a browser) to your @Controllers or @RestControllers.
  • So with these couple of filters, Spring Security provides you a login/logout page, as well as the ability to login with Basic Auth or Form Logins, as well as a couple of additional goodies like the CsrfFilter, that we are going to have a look at later.

save | comments | report | share on


Uploading Profile Pictures in a React and Rails API Application Part I

  • I ended up finding this amazing blog that walks through how to send images from a JavaScript front end to a Rails API backend.
  • In my case, I only want users to upload one image so I left the multiple attribute out and specified image/png and image/jpeg with the accept attribute to allow those file types.
  • In case you aren't familiar with dispatch, it is a store method in the Redux library that allows you to send actions to your store and trigger state changes.
  • At first I had specified a Content-Type in my configurationObject and was getting a bad request response (status 400) when sending my FormData to Rails.
  • Next week I will talk about the Rails side of things and how I am hosting my images on a cloud service, Cloudinary.

save | comments | report | share on


What happens when, Kubernetes edition

  • This ensures that requests that will always fail (e.g. creating a non-supported resource or using a malformed image name) will fail fast and not be sent to kube-apiserver.
  • After kubectl generates the runtime object, it starts to find the appropriate API group and version for it and then assembles a versioned client that is aware of the various REST semantics for the resource.
  • One thing that we didn't mention in the previous step is client authentication (this is handled before the HTTP request is sent), so let's look at that now.
  • The way kube-apiserver handles authorization is very similar to authentication: based on flag inputs, it will assemble a chain of authorizers that will be run against every incoming request.
  • In the next step, kube-apiserver deserializes the HTTP request, constructs runtime objects from them (kinda like the inverse process of kubectl's generators), and persists them to the datastore.

save | comments | report | share on


Ballerinas defy the corporeal in a quest for the ethereal (2019)

  • We will not disclose your personal information except: (1) as described by this Privacy Policy (2) after obtaining your permission to a specific use or disclosure or (3) if we are required to do so by a valid legal process or government request (such as a court order, a search warrant, a subpoena, a civil discovery request, or a statutory requirement).
  • Before that, dancers would occasionally rise beyond a ‘half pointe’ to a three-quarter pointe or fully on their toes without any type of special shoe as a sort of quick trick.
  • But the first boxed-toe pointe shoe wasn’t used until 1841, by the Italian dancer Carlotta Grisi.
  • These modern shoes, together with new technical demands, saw ballet dancers become true athletes: training for hours and hours a day, pushing and contorting their bodies to perform and perfect these predetermined shapes and movements codified in France hundreds of years earlier.

save | comments | report | share on