Back to front
Backend technologies for the frontend developer @geeky_android@androiddev.social
Slide 2
Who am I? Savvas Dalkitsis (he/him)
Principal Software Engineer @ASOS @geeky_android@androiddev.social
Slide 3
ASOS
Slide 4
Why am I here? @geeky_android@androiddev.social
Slide 5
ad b An
dro id
@geeky_android@androiddev.social
MVVMR Retrofit xJa v t a
P
MV er
UI
Pla
l i H
Da
gg
m o y Ro
ose mp Co
C te se Ma eba Fir
le d gra
Jet pa ck
I
MV ogle nes Go uti oro rial
ite sql
Studio
Slide 6
ng eri nd ~re de ~si ver ser
n
sql
no
co
nta
ine
rs
jwt
g kin loc ic~ ist tim op
s dn
ch ao s~m on key
ind
ep
uth oa
cd
sal t
ote
nc y
ingress~controller
u ion q ~ ct e g un a s f s e m
@geeky_android@androiddev.social
es oki co
ed non~blo ge cking ~ ~io g sw r e a t s ork eRt clu ers oun s e s d~ eu
rob in
Slide 7
So what? @geeky_android@androiddev.social
Slide 8
Language barriers are real in tech too.
Progressing your career means being able to have meaningful discussions with people outside your domain and comfort zone. A basic understanding of their language is paramount.
Source: cartoonresource/Adobe Stock @geeky_android@androiddev.social
Slide 9
Let’s start @geeky_android@androiddev.social
Slide 10
Caching
There are only two hard things in Computer Science: cache invalidation and naming things. Phil Karlton @geeky_android@androiddev.social
Caching
Server side controlled expiry @geeky_android@androiddev.social
Slide 15
Caching
Server side controlled expiry header Example Expires: Wed, 21 Oct 2015 07:28:00 GMT
Expires
@geeky_android@androiddev.social
Slide 16
Caching
Server side controlled expiry Cache-Control
Example
header
Cache-Control: max-age=604800
@geeky_android@androiddev.social
Slide 17
The following table lists the standard Cache-Control directives: Request Response max-age max-age max-stale min-fresh s-maxage no-cache no-cache no-store no-store no-transform no-transform only-if-cached -
_
Request Response must-revalidate proxy-revalidate must-understand private public immutable stale-while-revalidate stale-if-error stale-if-error
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
@geeky_android@androiddev.social
Slide 18
Caching
ETags @geeky_android@androiddev.social
Slide 19
What is an ETag?
The ETag (or entity tag) HTTP response header is an identifier for a specific version of a resource. It lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content was not changed. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag @geeky_android@androiddev.social
Slide 20
ETag = Unique Resource ID Example
ETag: “33a64df551425fcc55e4d42a148795d9f25f89d4”
@geeky_android@androiddev.social
Slide 21
Example
If-None-Match: “33a64df551425fcc55e4d42a148795d9f25f89d4”
@geeky_android@androiddev.social
Slide 22
ETag
Mid air conflicts @geeky_android@androiddev.social
Web Application/API Design @geeky_android@androiddev.social
Slide 32
Web Application/API Design
REST
Give it a REST
@geeky_android@androiddev.social
Slide 33
REST is a set of architectural constraints, not a protocol or a standard. API developers can implement REST in a variety of ways. https://www.redhat.com/en/topics/api/what-is-a-rest-api
@geeky_android@androiddev.social
Slide 34
Web Application/API Design
HTTP Verbs Oh CRUD
@geeky_android@androiddev.social
Slide 35
Does this look familiar? https://my.awesome/api/people/1/addAddress https://my.awesome/api/people/1/getAddress https://my.awesome/api/people/1/changeAddress https://my.awesome/api/people/1/deleteAddress
@geeky_android@androiddev.social
HTTP verbs, REST resources nouns POST
https://my.awesome/api/people/1/
address
GET
https://my.awesome/api/people/1/
address
PUT
https://my.awesome/api/people/1/
address
DELETE
https://my.awesome/api/people/1/
@geeky_android@androiddev.social
address
Slide 38
Web Application/API Design
Query parameters http://i.already/know?about=those
@geeky_android@androiddev.social
Slide 39
TL;DR;
If you ever see this in your api: https://something.or.other/login?username=rick&password=pickle from the mountaintops
@geeky_android@androiddev.social
Slide 40
Web Application/API Design
JWT wtj?
@geeky_android@androiddev.social
Slide 41
@geeky_android@androiddev.social
Slide 42
Web Application/API Design
OAuth oh oh ffff…
@geeky_android@androiddev.social
Web Application/API Design
Idempotency @geeky_android@androiddev.social
Slide 48
@geeky_android@androiddev.social
Slide 49
ETags 2 - Return of the UUID?
@geeky_android@androiddev.social
Slide 50
If we follow the REST principles in designing our APIs, we will have automatically idempotent REST APIs for GET, PUT, DELETE, HEAD, OPTIONS, and TRACE methods. Only POST APIs will not be idempotent. POST is NOT idempotent. GET , PUT , DELETE , HEAD , OPTIONS and TRACE are idempotent. https://restfulapi.net/idempotent-rest-apis/ @geeky_android@androiddev.social
Slide 51
Service topology @geeky_android@androiddev.social
Slide 52
Containers! Photo by Ian Taylor on Unsplash
Slide 53
@geeky_android@androiddev.social
Slide 54
Service topology
Microservices @geeky_android@androiddev.social
Slide 55
@geeky_android@androiddev.social
Slide 56
@geeky_android@androiddev.social
Slide 57
@geeky_android@androiddev.social
Slide 58
Service topology
DNS
@geeky_android@androiddev.social
Slide 59
Service topology
Clusters @geeky_android@androiddev.social
Slide 60
Service topology
Traffic Managers / Ingress controllers @geeky_android@androiddev.social