Impact	of	RESTful web	architecture on	performance	and	scalability Sanchit	Gera 2B	Computer	Engineering University	of	Waterloo
Overview • Background – Web	Services – Performance – Scalability • Introduction	to	REST • Characteristics	of	RESTful design • Summary • Conclusion 2
Web	Services • Means	of	exposing	functionality	or	data • Analogous	to	web	pages	for	machines • Facilitate	integration	between	applications • Tend	to	be	flexible	and	client	agnostic CLIENT SERVICE Request Response 3
Performance • Driven	by	a	number	of	factors,	some	of	which are	impacted	by	architectural	decisions • Performance	discussed	in	terms	of – Relates	to	issues	such	as	network	latency	and limited	network	bandwidth – Minimizing	data-trips	between	server	and	client – Minimizing	“message	overheads” 4
Scalability • Need	to	support	large	number	of	concurrent instances	or	interactions • Scaling	up - increasing	the	capacity	of services,	consumers,	and	network	devices (vertical	scaling) • Scaling	out - distributing	load	across	services and	programs	(horizontal	scaling) 5
Introduction	to	REST • REpresentationalState	Transfer • An	architectural	style	for	web	services • Open	ended	specifications • Utilizes	the	inherent	design	of	the	Web	for scalability	and	performance 6
Characteristics	of	REST • Uniform	interface • Stateless	system • Client-server	architecture • Cacheable • Layered	System • Code	on	Demand	(Optional) 7
Stateless	System • Server	does	not	store	any	context	between requests • Each	request	should	be	independent	and	self containing – Self	descriptive	messages • Any	session	state	is	held	on	the	client • Imposes	restrictions	on	the	communication allowed	between	services	and	consumers 8
Stateless	System 9
Stateless	System • Frees	up	service	memory	resources,	allowing the	service	to	scale	with	the	number	of concurrent	requests • Less	complicated	to	design	and	distribute across	servers	(horizontal	scaling) • Reduces	network	performance	by	increasing transmission	of	repetitive	data 10
Cacheable • Service	consumers	can	cache	and	reuse response	message	data • Responses	from	the	service	to	consumers	are labeled	as	cacheable	or	non-cacheable • Improves	runtime	efficiency	and	allows	for “lazy	replication” • Boosts	system	performance	by	reducing	user perceived	latency 11
Cacheable • Caches	work	mostly,	but	not	exclusively	with GET	requests • Implemented	either	implicitly,	explicitly	or through	negotiation • Better	user	perceived	performance • Lowers	perceived	network	latency • Reduces	load	on	the	database	boosting scalability 12
Layered	System • Solution	can	have	multiple	intermediary architectural	layers • No	one	layer	can	see	past	another • Request-response	mechanism	must	be transparent	to	end	client • Every	layer	has	a	single	high	level	purpose, boosting	separation	of	concerns • Allows	us	to	add	features	like	a	gateway,	a	load balancer,	or	a	firewall	to	accommodate	system scaling. 13
Conclusion • Brief	overview	of	REST	and	its	principles • Analysis	of	REST	principles	based	on	scalability and	performance – Statelessness	:	Performance	(Negative),	Scalability (Positive) – Cacheable	:	Performance	(Positive),	Scalability (Positive) – Layered	System	:	Performance	(Negative), Scalability	(Positive) 14

Impact of Restful Web Architecture on Performance and Scalability