SlideShare une entreprise Scribd logo
1  sur  29
Architecture and .NET Technologies

Panagiotis Kanavos

PITHOS
 Object storage similar to Amazon S3/Azure
  Blob storage
 A service of Synnefo
 Written in Python
 Clients for
  Web, Windows, iOS, Android, Linux
Synnefo
Client API

 REST API based on OpenStack Object
  Storage API
 Accounts, Containers without Folders
 GET for data, object info
 PUT, POST for uploads and data updates
Structure
API Extensions

  Block Storage
  Partial Upload/Download
  Permissions, Versions
  Metadata Queries
  UUIDs for Object IDs
  Object updates (copy, move)
API Characteristics

 No folders!
 Placeholder directory object hold metadata
 Block updates ONLY
 Merkle hashing to detect modified blocks
 Hash using SHA256
Merkle Hashing


                       Top Hash



       Hash of #1-                  Hash of #2-
        2 Hashes                     3 Hashes



 Block #1       Block #2      Block #3       Block #4
   Hash           Hash          Hash           Hash
Download Process


Get Hashmap    Calculate local    Find different
 from server     hashmap             blocks




 Download      Patch local file
  blocks        with blocks
Upload Process


                                   Server responds
Calculate local
                  PUT to server     with missing
  hashmap
                                    block hashes



 PUT missing
                                   Server responds
  blocks at       Repeat from #2
                                         201
container level
Pithos Client

 Multiple accounts per machine
 Synchronize local folder to Pithos account
 Detect local changes and upload
 Detect server changes and download
 Calculate Merkle Hash for each file
Client Architecture


   UI         Core         Networking    Storage


  WPF        File Agent
                            CloudFiles    SQLite
             Poll Agent
 MVVM
             Network
              Agent
                                         SQL Server
 Caliburn                   HttpClient
                                          Compact
  Micro     Status Agent
Technologies

 .ΝΕΤ 4, due to Windows XP support req
 Visual Studio 2012 + Async Targeting Pack
 UI - Caliburn.Micro
 Concurrency - TPL, Parallel, Dataflow
 Network – HttpClient
 Hashing - OpenSSL – Faster than native
  provider for hashing
 Storage - NHibernate, SQLite/SQL Server
  Compact
 Logging - log4net
The challenges

 Handle hundreds of file events
 Hashing of many large files
 Multiple slow connections to the server
 Unstable network
 Yet it shouldn’t hang
 Minimal UI with enough info for the user
Event Handling



                              Poll Agent                              Uploader/Downloader
• Listen                                   • Queue requests
• Wait for Idle       • Get Server         • Process each file    • Network ops for
                        hashes                                      files
                      • Compare hashes
                      • Identify changes
         File Agent                               Network Agent
Events Handling(2)

 Use producer/consumer
 Store events in ConcurrentQueue
 Process ONLY after an idle timeout
Merkle Hashing

 Why I hate Game of Thrones
 Asynchronous reading of blocks
 Block hashing in parallel
 Use OpenSSL to gain SSE2 etc
 Concurrency throttling
 Watch the memory consumption!
Memory Leaks in a Managed
Environment!
  4ΜΒ Blocks? Large Memory but …
  Quickly reading 2GB in 64ΚΒ blocks?
  Downloading 600ΜΒ in x KB blocks?
  Huge number of small objects awaiting collection
   during CPU/IO intensive processing
  Poor Garbage Collector can’t keep up!
Hashing  100% CPU?

 Multicore is nice but …
   Blocks the system when processing large files!
 Throttle parallel block hash ops
 Improvements:
   Dynamically throttle «large» files
   «Throttling» of File Read Ops
Multiple slow network calls

 Every call a Task
 Concurrent REST calls per account and
  shared folder
 Task.WhenAll to process results at end of poll
Unstable network

 Use System.Net.Http.HttpClient
 Store downloaded blocks in .pithos.cache
  folder
 Check and reuse orphans
 Asynchronous Retry of calls
Resistance to crashes

 Use Transactional NTFS where available
 Thanks MS for killing it!
 Modify a copy File.Replace otherwise
Should not hang

 Use independent agents
 Asynchronous operations wherever possible
 Use async/await for more readable code
 Must always .ConfigureAwait(false)!
 BE CAREFULL of async void
Minimal UI

 Use WPF, MVVM
 Use Progress to update the UI
   Part of .NET 4.5, backported to 4
 The Icon is the Shell!
 Lack of good WPF Notification Icon
 Problematic Data Binding in menus
SQLite or Compact CE?

  Initially SQLite -> Staleness problems (DUH !)
    Write Ahead logging, means you can see stale data
  Switch to SQL Compact to allow concurrent
   updates (duh ?)
    Really needed better caching?
    Akavache?
  A Document DB is better suited
Next Steps

 File Manager UI
 General Cleanup (DUH!)
 Bring back Unit Tests (Duh ?)
 Mock Server
   WebAPI? scriptcs? Yumm!
 Create a separate Pithos library
 Windows RT, Windows Phone clients
   AFTER the cleanup
Links for Pithos

 Pithos trial
  http://pithos.okeanos.io
 Synnefo Documentation
  http://www.synnefo.org/docs/synnefo/latest/ind
  ex.html
 Pithos API Documentation
  http://www.synnefo.org/docs/pithos/latest/index
  .html
 Pithos Windows Client
  https://code.grnet.gr/projects/pithos-ms-client
Useful Links

 Parallel FX Team blog
  http://blogs.msdn.com/b/pfxteam
 Caliburn.Micro
  http://caliburnmicro.codeplex.com/
 Ayende’s BufferPool
  http://ayende.com/blog/4827/answer-
  stopping-the-leaks
Useful Books

 C# 5 in a Nutshell, O’Riley
 Parallel Programming with .NET, Microsoft
• Pro Parallel Programming with C#, Wiley
• Concurrent Programming on Windows,
  Pearson
• The Art of Concurrency, O’Reilly

Contenu connexe

Tendances

What is Node.js? (ICON UK)
What is Node.js? (ICON UK)What is Node.js? (ICON UK)
What is Node.js? (ICON UK)Tim Davis
 
Ch 22: Web Hosting and Internet Servers
Ch 22: Web Hosting and Internet ServersCh 22: Web Hosting and Internet Servers
Ch 22: Web Hosting and Internet Serverswebhostingguy
 
An Introduction to Configuring Domino for Docker
An Introduction to Configuring Domino for DockerAn Introduction to Configuring Domino for Docker
An Introduction to Configuring Domino for DockerGabriella Davis
 
Nordic infrastructure Conference 2017 - SQL Server in DevOps
Nordic infrastructure Conference 2017 - SQL Server in DevOpsNordic infrastructure Conference 2017 - SQL Server in DevOps
Nordic infrastructure Conference 2017 - SQL Server in DevOpsTravis Wright
 
(ATS4-PLAT08) Server Pool Management
(ATS4-PLAT08) Server Pool Management(ATS4-PLAT08) Server Pool Management
(ATS4-PLAT08) Server Pool ManagementBIOVIA
 
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth RushgroveThe Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth RushgroveDocker, Inc.
 
From Monolith to Docker Distributed Applications
From Monolith to Docker Distributed ApplicationsFrom Monolith to Docker Distributed Applications
From Monolith to Docker Distributed ApplicationsCarlos Sanchez
 
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...Docker, Inc.
 
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...Docker, Inc.
 
SCUGBE_Lowlands_Unite_2017_Managing Windows Containers with Docker
SCUGBE_Lowlands_Unite_2017_Managing Windows Containers with DockerSCUGBE_Lowlands_Unite_2017_Managing Windows Containers with Docker
SCUGBE_Lowlands_Unite_2017_Managing Windows Containers with DockerKenny Buntinx
 
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...NETWAYS
 
201511 - Alfresco Day - Platform Update and Roadmap - Gabriele Columbro - Bo...
201511 -  Alfresco Day - Platform Update and Roadmap - Gabriele Columbro - Bo...201511 -  Alfresco Day - Platform Update and Roadmap - Gabriele Columbro - Bo...
201511 - Alfresco Day - Platform Update and Roadmap - Gabriele Columbro - Bo...Symphony Software Foundation
 
Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker ContainerJesus Guzman
 
A Survey of Container Security in 2016: A Security Update on Container Platforms
A Survey of Container Security in 2016: A Security Update on Container PlatformsA Survey of Container Security in 2016: A Security Update on Container Platforms
A Survey of Container Security in 2016: A Security Update on Container PlatformsSalman Baset
 
Flink 0.10 - Upcoming Features
Flink 0.10 - Upcoming FeaturesFlink 0.10 - Upcoming Features
Flink 0.10 - Upcoming FeaturesAljoscha Krettek
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with DockerDocker, Inc.
 
Terraform - Shared Definitions and Variable Inheritance
Terraform - Shared Definitions and Variable InheritanceTerraform - Shared Definitions and Variable Inheritance
Terraform - Shared Definitions and Variable InheritanceDave Rix
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache MesosCI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache MesosCarlos Sanchez
 
Docker-Vancouver Meetup - March 18, 2014 - Contain(erize) the tests - Mark Ei...
Docker-Vancouver Meetup - March 18, 2014 - Contain(erize) the tests - Mark Ei...Docker-Vancouver Meetup - March 18, 2014 - Contain(erize) the tests - Mark Ei...
Docker-Vancouver Meetup - March 18, 2014 - Contain(erize) the tests - Mark Ei...bacongobbler
 
Best Practices for Installing IBM Verse on Premises
Best Practices for Installing IBM Verse on PremisesBest Practices for Installing IBM Verse on Premises
Best Practices for Installing IBM Verse on PremisesTimsterC
 

Tendances (20)

What is Node.js? (ICON UK)
What is Node.js? (ICON UK)What is Node.js? (ICON UK)
What is Node.js? (ICON UK)
 
Ch 22: Web Hosting and Internet Servers
Ch 22: Web Hosting and Internet ServersCh 22: Web Hosting and Internet Servers
Ch 22: Web Hosting and Internet Servers
 
An Introduction to Configuring Domino for Docker
An Introduction to Configuring Domino for DockerAn Introduction to Configuring Domino for Docker
An Introduction to Configuring Domino for Docker
 
Nordic infrastructure Conference 2017 - SQL Server in DevOps
Nordic infrastructure Conference 2017 - SQL Server in DevOpsNordic infrastructure Conference 2017 - SQL Server in DevOps
Nordic infrastructure Conference 2017 - SQL Server in DevOps
 
(ATS4-PLAT08) Server Pool Management
(ATS4-PLAT08) Server Pool Management(ATS4-PLAT08) Server Pool Management
(ATS4-PLAT08) Server Pool Management
 
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth RushgroveThe Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
 
From Monolith to Docker Distributed Applications
From Monolith to Docker Distributed ApplicationsFrom Monolith to Docker Distributed Applications
From Monolith to Docker Distributed Applications
 
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
 
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
 
SCUGBE_Lowlands_Unite_2017_Managing Windows Containers with Docker
SCUGBE_Lowlands_Unite_2017_Managing Windows Containers with DockerSCUGBE_Lowlands_Unite_2017_Managing Windows Containers with Docker
SCUGBE_Lowlands_Unite_2017_Managing Windows Containers with Docker
 
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...
 
201511 - Alfresco Day - Platform Update and Roadmap - Gabriele Columbro - Bo...
201511 -  Alfresco Day - Platform Update and Roadmap - Gabriele Columbro - Bo...201511 -  Alfresco Day - Platform Update and Roadmap - Gabriele Columbro - Bo...
201511 - Alfresco Day - Platform Update and Roadmap - Gabriele Columbro - Bo...
 
Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker Container
 
A Survey of Container Security in 2016: A Security Update on Container Platforms
A Survey of Container Security in 2016: A Security Update on Container PlatformsA Survey of Container Security in 2016: A Security Update on Container Platforms
A Survey of Container Security in 2016: A Security Update on Container Platforms
 
Flink 0.10 - Upcoming Features
Flink 0.10 - Upcoming FeaturesFlink 0.10 - Upcoming Features
Flink 0.10 - Upcoming Features
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 
Terraform - Shared Definitions and Variable Inheritance
Terraform - Shared Definitions and Variable InheritanceTerraform - Shared Definitions and Variable Inheritance
Terraform - Shared Definitions and Variable Inheritance
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache MesosCI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
 
Docker-Vancouver Meetup - March 18, 2014 - Contain(erize) the tests - Mark Ei...
Docker-Vancouver Meetup - March 18, 2014 - Contain(erize) the tests - Mark Ei...Docker-Vancouver Meetup - March 18, 2014 - Contain(erize) the tests - Mark Ei...
Docker-Vancouver Meetup - March 18, 2014 - Contain(erize) the tests - Mark Ei...
 
Best Practices for Installing IBM Verse on Premises
Best Practices for Installing IBM Verse on PremisesBest Practices for Installing IBM Verse on Premises
Best Practices for Installing IBM Verse on Premises
 

Similaire à Architecture and .NET Technologies for Pithos Object Storage

Fluentd Overview, Now and Then
Fluentd Overview, Now and ThenFluentd Overview, Now and Then
Fluentd Overview, Now and ThenSATOSHI TAGOMORI
 
Globo.com & Varnish
Globo.com & VarnishGlobo.com & Varnish
Globo.com & Varnishlokama
 
Fluentd at Bay Area Kubernetes Meetup
Fluentd at Bay Area Kubernetes MeetupFluentd at Bay Area Kubernetes Meetup
Fluentd at Bay Area Kubernetes MeetupSadayuki Furuhashi
 
Stac summit june 14th - goodbye datalakes
Stac summit june 14th - goodbye datalakesStac summit june 14th - goodbye datalakes
Stac summit june 14th - goodbye datalakesiguazio
 
Building Super Fast Cloud-Native Data Platforms - Yaron Haviv, KubeCon 2017 EU
Building Super Fast Cloud-Native Data Platforms - Yaron Haviv, KubeCon 2017 EUBuilding Super Fast Cloud-Native Data Platforms - Yaron Haviv, KubeCon 2017 EU
Building Super Fast Cloud-Native Data Platforms - Yaron Haviv, KubeCon 2017 EUYaron Haviv
 
DCEU 18: Provisioning and Managing Storage for Docker Containers
DCEU 18: Provisioning and Managing Storage for Docker ContainersDCEU 18: Provisioning and Managing Storage for Docker Containers
DCEU 18: Provisioning and Managing Storage for Docker ContainersDocker, Inc.
 
Beyond the File System - Designing Large Scale File Storage and Serving
Beyond the File System - Designing Large Scale File Storage and ServingBeyond the File System - Designing Large Scale File Storage and Serving
Beyond the File System - Designing Large Scale File Storage and Servingmclee
 
Filesystems
FilesystemsFilesystems
Filesystemsroyans
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Bhupesh Bansal
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop User Group
 
Turning object storage into vm storage
Turning object storage into vm storageTurning object storage into vm storage
Turning object storage into vm storagewim_provoost
 
Apache Hudi: The Path Forward
Apache Hudi: The Path ForwardApache Hudi: The Path Forward
Apache Hudi: The Path ForwardAlluxio, Inc.
 
Planning for-high-performance-web-application
Planning for-high-performance-web-applicationPlanning for-high-performance-web-application
Planning for-high-performance-web-applicationNguyễn Duy Nhân
 
[Mas 500] Various Topics
[Mas 500] Various Topics[Mas 500] Various Topics
[Mas 500] Various Topicsrahulbot
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container EraSadayuki Furuhashi
 

Similaire à Architecture and .NET Technologies for Pithos Object Storage (20)

Fluentd Overview, Now and Then
Fluentd Overview, Now and ThenFluentd Overview, Now and Then
Fluentd Overview, Now and Then
 
Globo.com & Varnish
Globo.com & VarnishGlobo.com & Varnish
Globo.com & Varnish
 
Fluentd at Bay Area Kubernetes Meetup
Fluentd at Bay Area Kubernetes MeetupFluentd at Bay Area Kubernetes Meetup
Fluentd at Bay Area Kubernetes Meetup
 
Stac summit june 14th - goodbye datalakes
Stac summit june 14th - goodbye datalakesStac summit june 14th - goodbye datalakes
Stac summit june 14th - goodbye datalakes
 
Building Super Fast Cloud-Native Data Platforms - Yaron Haviv, KubeCon 2017 EU
Building Super Fast Cloud-Native Data Platforms - Yaron Haviv, KubeCon 2017 EUBuilding Super Fast Cloud-Native Data Platforms - Yaron Haviv, KubeCon 2017 EU
Building Super Fast Cloud-Native Data Platforms - Yaron Haviv, KubeCon 2017 EU
 
DCEU 18: Provisioning and Managing Storage for Docker Containers
DCEU 18: Provisioning and Managing Storage for Docker ContainersDCEU 18: Provisioning and Managing Storage for Docker Containers
DCEU 18: Provisioning and Managing Storage for Docker Containers
 
Afs manager
Afs managerAfs manager
Afs manager
 
Beyond the File System - Designing Large Scale File Storage and Serving
Beyond the File System - Designing Large Scale File Storage and ServingBeyond the File System - Designing Large Scale File Storage and Serving
Beyond the File System - Designing Large Scale File Storage and Serving
 
Filesystems
FilesystemsFilesystems
Filesystems
 
AFS introduction
AFS introductionAFS introduction
AFS introduction
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
 
Kosmos Filesystem
Kosmos FilesystemKosmos Filesystem
Kosmos Filesystem
 
Turning object storage into vm storage
Turning object storage into vm storageTurning object storage into vm storage
Turning object storage into vm storage
 
CakePHP 3.0: Embracing the future
CakePHP 3.0: Embracing the futureCakePHP 3.0: Embracing the future
CakePHP 3.0: Embracing the future
 
Apache Hudi: The Path Forward
Apache Hudi: The Path ForwardApache Hudi: The Path Forward
Apache Hudi: The Path Forward
 
Planning for-high-performance-web-application
Planning for-high-performance-web-applicationPlanning for-high-performance-web-application
Planning for-high-performance-web-application
 
Open ebs 101
Open ebs 101Open ebs 101
Open ebs 101
 
[Mas 500] Various Topics
[Mas 500] Various Topics[Mas 500] Various Topics
[Mas 500] Various Topics
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container Era
 

Plus de Panagiotis Kanavos

The server side story: Parallel and Asynchronous programming in .NET - ITPro...
The server side story:  Parallel and Asynchronous programming in .NET - ITPro...The server side story:  Parallel and Asynchronous programming in .NET - ITPro...
The server side story: Parallel and Asynchronous programming in .NET - ITPro...Panagiotis Kanavos
 
77o dotNETZone Meetup: Pattern matching expressions. One small step for one l...
77o dotNETZone Meetup: Pattern matching expressions. One small step for one l...77o dotNETZone Meetup: Pattern matching expressions. One small step for one l...
77o dotNETZone Meetup: Pattern matching expressions. One small step for one l...Panagiotis Kanavos
 
65ο DotNetZone event: Tpl data flow και railway oriented programming
65ο DotNetZone event: Tpl data flow και railway oriented programming65ο DotNetZone event: Tpl data flow και railway oriented programming
65ο DotNetZone event: Tpl data flow και railway oriented programmingPanagiotis Kanavos
 
Περατζάδα στο Azure Event Hub
Περατζάδα στο Azure Event HubΠερατζάδα στο Azure Event Hub
Περατζάδα στο Azure Event HubPanagiotis Kanavos
 
Το Azure δεν είναι χορτοφάγο! - 59ο DotNetZone Event
Το Azure δεν είναι χορτοφάγο! - 59ο DotNetZone EventΤο Azure δεν είναι χορτοφάγο! - 59ο DotNetZone Event
Το Azure δεν είναι χορτοφάγο! - 59ο DotNetZone EventPanagiotis Kanavos
 
The Server-SIde Story: Παράλληλος και ασύγχρονος προγραμματισμός στο .NET - I...
The Server-SIde Story: Παράλληλος και ασύγχρονος προγραμματισμός στο .NET - I...The Server-SIde Story: Παράλληλος και ασύγχρονος προγραμματισμός στο .NET - I...
The Server-SIde Story: Παράλληλος και ασύγχρονος προγραμματισμός στο .NET - I...Panagiotis Kanavos
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)Panagiotis Kanavos
 
Πίθος - Αρχιτεκτονική και τεχνολογίες .NET
Πίθος - Αρχιτεκτονική και τεχνολογίες .NETΠίθος - Αρχιτεκτονική και τεχνολογίες .NET
Πίθος - Αρχιτεκτονική και τεχνολογίες .NETPanagiotis Kanavos
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (Greek)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (Greek)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (Greek)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (Greek)Panagiotis Kanavos
 
Real Life Task Parallel Library, ITProDevConnections 2011 (Greek)
Real Life Task Parallel Library, ITProDevConnections 2011 (Greek)Real Life Task Parallel Library, ITProDevConnections 2011 (Greek)
Real Life Task Parallel Library, ITProDevConnections 2011 (Greek)Panagiotis Kanavos
 

Plus de Panagiotis Kanavos (11)

The server side story: Parallel and Asynchronous programming in .NET - ITPro...
The server side story:  Parallel and Asynchronous programming in .NET - ITPro...The server side story:  Parallel and Asynchronous programming in .NET - ITPro...
The server side story: Parallel and Asynchronous programming in .NET - ITPro...
 
77o dotNETZone Meetup: Pattern matching expressions. One small step for one l...
77o dotNETZone Meetup: Pattern matching expressions. One small step for one l...77o dotNETZone Meetup: Pattern matching expressions. One small step for one l...
77o dotNETZone Meetup: Pattern matching expressions. One small step for one l...
 
65ο DotNetZone event: Tpl data flow και railway oriented programming
65ο DotNetZone event: Tpl data flow και railway oriented programming65ο DotNetZone event: Tpl data flow και railway oriented programming
65ο DotNetZone event: Tpl data flow και railway oriented programming
 
Περατζάδα στο Azure Event Hub
Περατζάδα στο Azure Event HubΠερατζάδα στο Azure Event Hub
Περατζάδα στο Azure Event Hub
 
Ο βασιλιάς Git!
Ο βασιλιάς Git!Ο βασιλιάς Git!
Ο βασιλιάς Git!
 
Το Azure δεν είναι χορτοφάγο! - 59ο DotNetZone Event
Το Azure δεν είναι χορτοφάγο! - 59ο DotNetZone EventΤο Azure δεν είναι χορτοφάγο! - 59ο DotNetZone Event
Το Azure δεν είναι χορτοφάγο! - 59ο DotNetZone Event
 
The Server-SIde Story: Παράλληλος και ασύγχρονος προγραμματισμός στο .NET - I...
The Server-SIde Story: Παράλληλος και ασύγχρονος προγραμματισμός στο .NET - I...The Server-SIde Story: Παράλληλος και ασύγχρονος προγραμματισμός στο .NET - I...
The Server-SIde Story: Παράλληλος και ασύγχρονος προγραμματισμός στο .NET - I...
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
 
Πίθος - Αρχιτεκτονική και τεχνολογίες .NET
Πίθος - Αρχιτεκτονική και τεχνολογίες .NETΠίθος - Αρχιτεκτονική και τεχνολογίες .NET
Πίθος - Αρχιτεκτονική και τεχνολογίες .NET
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (Greek)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (Greek)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (Greek)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (Greek)
 
Real Life Task Parallel Library, ITProDevConnections 2011 (Greek)
Real Life Task Parallel Library, ITProDevConnections 2011 (Greek)Real Life Task Parallel Library, ITProDevConnections 2011 (Greek)
Real Life Task Parallel Library, ITProDevConnections 2011 (Greek)
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 

Dernier (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 

Architecture and .NET Technologies for Pithos Object Storage

  • 1. Architecture and .NET Technologies Panagiotis Kanavos PITHOS
  • 2.  Object storage similar to Amazon S3/Azure Blob storage  A service of Synnefo  Written in Python  Clients for Web, Windows, iOS, Android, Linux
  • 4. Client API  REST API based on OpenStack Object Storage API  Accounts, Containers without Folders  GET for data, object info  PUT, POST for uploads and data updates
  • 6. API Extensions  Block Storage  Partial Upload/Download  Permissions, Versions  Metadata Queries  UUIDs for Object IDs  Object updates (copy, move)
  • 7. API Characteristics  No folders!  Placeholder directory object hold metadata  Block updates ONLY  Merkle hashing to detect modified blocks  Hash using SHA256
  • 8. Merkle Hashing Top Hash Hash of #1- Hash of #2- 2 Hashes 3 Hashes Block #1 Block #2 Block #3 Block #4 Hash Hash Hash Hash
  • 9. Download Process Get Hashmap Calculate local Find different from server hashmap blocks Download Patch local file blocks with blocks
  • 10. Upload Process Server responds Calculate local PUT to server with missing hashmap block hashes PUT missing Server responds blocks at Repeat from #2 201 container level
  • 11. Pithos Client  Multiple accounts per machine  Synchronize local folder to Pithos account  Detect local changes and upload  Detect server changes and download  Calculate Merkle Hash for each file
  • 12. Client Architecture UI Core Networking Storage WPF File Agent CloudFiles SQLite Poll Agent MVVM Network Agent SQL Server Caliburn HttpClient Compact Micro Status Agent
  • 13. Technologies  .ΝΕΤ 4, due to Windows XP support req  Visual Studio 2012 + Async Targeting Pack  UI - Caliburn.Micro  Concurrency - TPL, Parallel, Dataflow  Network – HttpClient  Hashing - OpenSSL – Faster than native provider for hashing  Storage - NHibernate, SQLite/SQL Server Compact  Logging - log4net
  • 14. The challenges  Handle hundreds of file events  Hashing of many large files  Multiple slow connections to the server  Unstable network  Yet it shouldn’t hang  Minimal UI with enough info for the user
  • 15. Event Handling Poll Agent Uploader/Downloader • Listen • Queue requests • Wait for Idle • Get Server • Process each file • Network ops for hashes files • Compare hashes • Identify changes File Agent Network Agent
  • 16. Events Handling(2)  Use producer/consumer  Store events in ConcurrentQueue  Process ONLY after an idle timeout
  • 17. Merkle Hashing  Why I hate Game of Thrones  Asynchronous reading of blocks  Block hashing in parallel  Use OpenSSL to gain SSE2 etc  Concurrency throttling  Watch the memory consumption!
  • 18. Memory Leaks in a Managed Environment!  4ΜΒ Blocks? Large Memory but …  Quickly reading 2GB in 64ΚΒ blocks?  Downloading 600ΜΒ in x KB blocks?  Huge number of small objects awaiting collection during CPU/IO intensive processing  Poor Garbage Collector can’t keep up!
  • 19. Hashing  100% CPU?  Multicore is nice but …  Blocks the system when processing large files!  Throttle parallel block hash ops  Improvements:  Dynamically throttle «large» files  «Throttling» of File Read Ops
  • 20. Multiple slow network calls  Every call a Task  Concurrent REST calls per account and shared folder  Task.WhenAll to process results at end of poll
  • 21. Unstable network  Use System.Net.Http.HttpClient  Store downloaded blocks in .pithos.cache folder  Check and reuse orphans  Asynchronous Retry of calls
  • 22. Resistance to crashes  Use Transactional NTFS where available  Thanks MS for killing it!  Modify a copy File.Replace otherwise
  • 23. Should not hang  Use independent agents  Asynchronous operations wherever possible  Use async/await for more readable code  Must always .ConfigureAwait(false)!  BE CAREFULL of async void
  • 24. Minimal UI  Use WPF, MVVM  Use Progress to update the UI  Part of .NET 4.5, backported to 4  The Icon is the Shell!  Lack of good WPF Notification Icon  Problematic Data Binding in menus
  • 25. SQLite or Compact CE?  Initially SQLite -> Staleness problems (DUH !)  Write Ahead logging, means you can see stale data  Switch to SQL Compact to allow concurrent updates (duh ?)  Really needed better caching?  Akavache?  A Document DB is better suited
  • 26. Next Steps  File Manager UI  General Cleanup (DUH!)  Bring back Unit Tests (Duh ?)  Mock Server  WebAPI? scriptcs? Yumm!  Create a separate Pithos library  Windows RT, Windows Phone clients  AFTER the cleanup
  • 27. Links for Pithos  Pithos trial http://pithos.okeanos.io  Synnefo Documentation http://www.synnefo.org/docs/synnefo/latest/ind ex.html  Pithos API Documentation http://www.synnefo.org/docs/pithos/latest/index .html  Pithos Windows Client https://code.grnet.gr/projects/pithos-ms-client
  • 28. Useful Links  Parallel FX Team blog http://blogs.msdn.com/b/pfxteam  Caliburn.Micro http://caliburnmicro.codeplex.com/  Ayende’s BufferPool http://ayende.com/blog/4827/answer- stopping-the-leaks
  • 29. Useful Books  C# 5 in a Nutshell, O’Riley  Parallel Programming with .NET, Microsoft • Pro Parallel Programming with C#, Wiley • Concurrent Programming on Windows, Pearson • The Art of Concurrency, O’Reilly