Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
kranonit S06E01 Игорь Цинько: High load
1. High Load: If Chuck Norris is your customer
Igor Tsinko
Igor.Tsinko@gmail.com
linkedin.com/in/IgorTsinko
goo.gl/7gidp
#kranonit S06E01
23.12.2012
2. Igor Tsinko aka combats
● Java developer at
● In IT since 2003
● 6 years PHP using, year of Java
● linkedin.com/in/IgorTsinko
● Nur.kz (Connect.ua)
● TomTom
● VoxTelecom
3. Sergey Ponomarev aka stokito
● Grails developer at
● In IT since 2006
● Delphi, PHP, Java, Groovy
● Java coucher
● stokito.moikrug.ru
● stokito.blogspot.com
● HotWire.com
4. ● Vertical vs. Horizontal scaling
● Architecture
● NoSQL vs. RDBMS
● Tools
Agenda
16. MongoDB
● Document oriented: schema less, easy to work with
● ObjectId timestamp, machine identifier, process id, counter
● JSON format:
{
"_id" : ObjectId("497ce96f395f2f052a494fd4"),
"title" : "Awesome Blog Post",
"body" : "Text text text text, text text text ...",
"created": "Tue, 3 Jan 2011 11:13:56 GMT",
"tags" : [ "css", "javascipt", "jquery" ],
"comments" : [
{
"name" : "Kelly Glover"
"text" : "This is a very good ..."
},
],
}
17.
18. Adding new NoSQL node is easy
Nodes are in ring
They know about each
other
Recalculating keys/nodes
25. How to test NoSQL
● Simple Integration tests (simple like in
RDBMS)
● Storage - is a "bottleneck", but it testable
● New tools are come to us: NoSQLUnit -
simple like DBUnit in RDBMS world
● Good point for managers - just rewrite your
DAO
27. Data retention policy
● What is your data lifecycle?
● How many records in table?
● How often it would be update?
● Is it read only?
● Data lifecycle: create, update, expire, clean
● More reads or writes?
● How often to clean old data?
28. "Cache" your DAO
● Static blocks on page
● "slow-to update" data
Levels of caching:
1. Object in DB session of application (ORM)
2. In-memory shared with process: Memcached, EhCache
3. Query caching: Sphinx, Hibernate
29. Memcached
SQL request for static data - is very expensive
Cheap decision:
// get object from memcached
Memchached cities = get("cities_key")
if (cities == null) {
// make your SQL or whatever you do
citiesList = query("SELECT * FROM cities")
cities.set(citiesList, 60, "cities_key")
}
return cities
30. Memcached proc & cons
● Really quick access
● Good for little pieces of data
● Key-value
● Not so stable on real high load
● You will loose your business if you reboot all
your memcache :)
● 1mb objects by default
31. Memcache: how-to: team lead to
beat shit out from you
● Cache transactional requests
● Drop data from cache
32. Search on site: how-to kill your
server, step-by-step manual
● SELECT * FROM ... CROSS JOIN ...
● Aggregation requests
● Wrong, or non-effective indexes
33. Move to Sphinx
● Optimization by requests criteria
● Full-text index
● Optimisation and management your
requests
34. Other search engines and cache
optimization tools
● Solr (Lucene) from Apache - Java
world
● Google search on your site :)
35. Store your images - Varnish
It's just yet another http accelerator
● Store and shape your images
● In-Memory based
● Manage your files
● It's not a hard drive (with 300 threads/s max)
36. Manage your video storages
● FFMpeg - best tool for conversion
● Always save original file
● User should understand that video doesn't
appear in seconds
● Prepare your preview - use varnish
37. Bandwidth and video - or how-to
save your ass from angry team lead
● Don't use default configuration
● Shape your bandwidth (include geotargeting)
● Monetisation from your shaped bandwidth
● MP4 shaping on little pieces
38. Storages architecture
● Always use "rings"
● Always protect your data - use 3 server per
ring with load balancer
● App servers min value >= 2
● Your SQL server - always with master-slave,
master-master replication
● What is more important data for you - pics
with cats or commercial data?
39. When clouds are cool and when are not...
● Ping
● Servers reliability
● Private data
40. Why manager kick your ass for
mongoDB in clouds
● MongoDB has master-node, in clouds you
can't control servers reliability
● Every technology - is good decision for
clouds... unless you don't care about 30's
downtime
41. Technologies that uses our colleagues
● Google map-reduce
● Google Big Data
Open source:
● Hadoop
● HBase
● ZooKeeper
42. Dependencies and limitations on the High
Load architecture
● A lot of convention over configuration
● Turn off your cache - turn off your business
● You live in crashing world
● Much more qualified developer need
43. Conclusions
● Use technologies only if it's business require
● You're lucky if you have High Load
● Persistence is bottleneck in any project: make
sure that you have good architecture - use
DAO, decompose as more as you can
● Use SQL and vertical scale as much as
possible
44. Что почитать?
● NoSQL DB - большой взрыв и расширяющаяся
вселенная практических применений
● NoSQL базы данных: понимаем суть
● Записи встреч Клуба анонимных разработчиков
#uadevclub
● Кайл Бэнкер: MongoDB в действии
● myforce.ru
● insight-it.ru/highload
● highload.ru