Lviv IT Arena is a conference specially designed for programmers, designers, developers, top managers, inverstors, entrepreneur and startuppers. Annually it takes place on 2-4 of October in Lviv at the Arena Lviv stadium. In 2015 conference gathered more than 1400 participants and over 100 speakers from companies like Facebook. FitBit, Mail.ru, HP, Epson and IBM. More details about conference at itarene.lviv.ua.
8. Основные понятия Orleans
• Grains (virtual actors): stateless, stateful
• Grain interfaces (contract)
• Silos (grain hosting and execution)
• Clients
• Client observers
2
9. Grain
• Существует всегда
• Активируются автоматически
• Существует везде
• Масштабируется автоматически
– только stateless worker activation mode
(immutable or no state)
2
10. Grain interface, Grain reference
• Контракт взаимодействия между grains
• C# interface
• Все методы асинхронные (возвращают Task
или Task<T>)
• Grain reference – прокси для взаимодействия с
grain
• Grain reference можно взять из фабрики,
вернуть из метода, передать параметром
• Grain reference не требует явной привязки к
активации grain
2
11. Promise, Turn
• Все методы grains асинхронные: вызов
метода не блокируется, возвращая Task<T>
• TPL и await
• Все активации однопоточные
• 1 ход – последовательность вызовов,
которая приводит к завершенному
результату
2
14. Итого
• Простой фреймворк для эффективной разработки
распределенных приложений
• Не подходит для некоторых сценариев
– переменная нагрузка с большим/малым
количеством сущностей
– нет поддержки транзакций (между grain-ами)
• at least once гарантия доставки сообщения (не at
most once)
• Нет поддержки FIFO при передаче сообщений
2
Distributed programming is the art of solving the same problem that you can solve on a single computer using multiple computers - usually, because the problem no longer fits on a single computer.
When it comes to partition tolerant consensus algorithms, the most well-known algorithm is the Paxos algorithm.
It is, however, notoriously difficult to implement and explain. Raft, a recent (~early 2013) algorithm designed to be easier to teach and implement.
Actor platforms such as Erlang and Akka are a step forward in simplifying distributed system programming.
По умолчанию grain не может одновременно участвовать в разных ходах
Reentrant grain – позволяет одновременно обрабатывать несколько запросов