It is first lecture from noSQL course for students of Lviv Polytechnic National University. Check out our educational portal: http://academy.binary-studio.com/
2. Who am I?
Beseda Dmitriy
Web developer at Binary Studio
email: BesedaDG@gmail.com
email: dmitriy.beseda@binary-studio.com
skype: dmitriy.b_binary
facebook:
https://www.facebook.com/profile.php?id=1000017844
45579
3. Plan
1. Data nowadays
2. SQL advantages / disadvantages
3. NoSQL advantages / disadvantages
4. NoSQL history
5. SQL and NoSQL similarities and differences
6. ORM / ODM
7. Myths
8. Conclusions
5. Data evolution
- Data and web apps are growing rapidly day by day
- Hardware cannot keep pace with data growth
- Apps are moving to Cloud and becoming API driven
Conclusion: It is hard to scale data in a traditional way
6. Data in business
Business is successful if data are used properly
- Statistic, reports
- Real-time
- Recommendations
Conclusion:
- Web apps should be real-time and interactive
- User and services databases grow from tera to peta bytes each day
7. Pay attention
● CRUD (Create Read Update Delete) operations
- Performance
- Reliability
● Data consistency (ACID) & Distributed network
- Parallel immediate access
- Updates applying time to all users
● Loading
- Data replication
8. Advantages:
● No duplications
● Data integrity
● Transactions
● Actions sequence
● Security
● Data consistency
SQL
Disadvantages:
● Performance
● Work in distributed environment
(locks)
● Horizontal scaling complexity
● Additional language to manipulate
with data
● Scaling and Sharding
10. NoSQL
Advantages:
● Performance (aggregation)
● Schemaless (easy to add / remove
properties)
● Horizontal scaling (& sharding)
● Way of using memory
● Open source
Disadvantages:
● Absence of transactions
● Embedding limitations
● Lots of manual work (joins are
absent)
● Model format is not guaranteed
12. NoSQL history
In 1998 Carlo Strozzi implemented an open source DB, that
stored ASCII files and used shell scripts for data manipulations
In June 2009 Eric Evans proposed NoSQL as a Twitter #tag for a
conference for existing distributed databases
13. - Consistency - “Is the data I am looking at now the same if I look at it somewhere
else”
- Availability - “What will happen if my database goes down?”
- Partitioning - “What if my data is on a different node?”
SQL - CA
NoSQL - AP
CAP theorem (Consistency, Availability and Partition-tolerance)
14. SQL and NoSQL similarities
● Primary key or Id is necessary and unique
● Indexes help to increase performance
● Relationships exist
15. Goals of normalization
- Free the database of modification anomalies (references)
- Minimize redesign
- Avoid any bias toward any particular access pattern
23. Myths
- NoSQL supersedes SQL
- NoSQL is better / worse than SQL
- SQL vs NoSQL is a clear distinction
- The language/framework determines the database
24. Use SQL if:
● Data integrity is essential
● Standards-based proven technologies with good developer experience and
support
● Logical related discrete data requirements which can be identified up-front
● Prefer SQL
25. Use NoSQL if:
● Data requirements are unrelated, indeterminate or evolving
● Project objectives are simpler of less specific and allow starting to code
immediately
● Speed and scalability is imperative
● Prefer NoSQL
26. Always remember
● Если бы мы действительно ждали завершения каждой транзакции в мировой сети ATM (банкоматов),
транзакции занимали бы столько времени, что клиенты убегали бы прочь в ярости. Что происходит, если ты и
твой партнер снимаете деньги одновременно и превышаете лимит? — Вы оба получите деньги, а мы поправим
это позже.
● Мы вступаем в эру polyglot persistence — эру, когда для различных потребностей используются разные
хранилища данных. Теперь нет монополизма реляционных баз данных, как безальтернативного источника
данных. Все чаще архитекторы выбирают хранилище исходя из природы самих данных и того, как мы ими
хотим манипулировать, какие объемы информации ожидаются. И поэтому все становится только интереснее.
● A well-designed SQL database will almost certainly perform better than a badly designed NoSQL equivalent and vice
versa.
27.
28. Summary
SQL - works great, isn’t scalable for large data
😞
NoSQL - works great, isn’t suitable for everyone
😞
SQL + NoSQL 😊
Рассказать про проект Андрюхи и его прикол с MS SQL DB
главный лейтмотив развития NoSQL баз. С лавинообразным ростом информации в мире и необходимости ее обрабатывать за разумное время встала проблема вертикальной масштабируемости — рост скорости процессора остановился на 3.5 Ггц, скорость чтения с диска также растет тихими темпами, плюс цена мощного сервера всегда больше суммарной цены нескольких простых серверов.
Главный лейтмотив развития NoSQL баз. С лавинообразным ростом информации в мире и необходимости ее обрабатывать за разумное время встала проблема вертикальной масштабируемости — рост скорости процессора остановился на 3.5 Ггц, скорость чтения с диска также растет тихими темпами, плюс цена мощного сервера всегда больше суммарной цены нескольких простых серверов.
Facebook uses primary mysql and cassandra for search
Rich documents - can contain Numbers, Strings, Another documents and arraysNo constraint - foreign keys, etc
NoSQL is not a replacement for SQL — it’s an alternative
It depends on project
Some SQL databases are adopting NoSQL features and vice versa
LAMP: Linux, Apache, MySQL (SQL), PHP
MEAN: MongoDB (NoSQL), Express, Angular, Node.js
.NET, IIS and SQL Server
Java, Apache and Oracle.