building a personal cloud storage service

33
Building a Personal Cloud Storage Service Volkan Esgel Turkcell August 24, 2016

Upload: tesora

Post on 08-Feb-2017

73 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Building a Personal Cloud Storage Service

Building a Personal Cloud Storage ServiceVolkan EsgelTurkcellAugust 24, 2016

Page 2: Building a Personal Cloud Storage Service

2

About Me

Volkan EsgelSenior Software Engineer

TURKCELL

Page 3: Building a Personal Cloud Storage Service

3

About Turkcell

* http://investor.turkcell.com.tr/2015/turkcell-group

Integrated communication and technology services

player in TurkeyTurkcell Global

9 countries

68,9 million total subscribers1,5 million fixed

subscribers 600 thousand TV subscribers

Page 4: Building a Personal Cloud Storage Service

IntroductionLegacy Solution Current Solution

Page 5: Building a Personal Cloud Storage Service

5

Legacy Solution

Adding features was costly (time & budget) User Experience

not good

No Folder Structureonly tagging

Security Issues

Page 6: Building a Personal Cloud Storage Service

6

Current Solution

Distributed

Fast

Fault Tolerant

Highly Scalable

Extendable

New features can be added easily

Page 7: Building a Personal Cloud Storage Service

7

Technologies

Spring FrameworkOpenStack

Keystone & SWIFTElasticSearch

RabbitMQ

Oracle DB ImageMagick

FFmpeg

Page 8: Building a Personal Cloud Storage Service

8

Page 9: Building a Personal Cloud Storage Service

9

OpenStack Projects

Page 10: Building a Personal Cloud Storage Service

10

Main Projects

Business OpenStack

Page 11: Building a Personal Cloud Storage Service

11

* Keystone v2.0 (with OS-KSADM extension) / SWIFT v1

Account (Project / Tenant)

User

Container(s)

Main Extended

Page 12: Building a Personal Cloud Storage Service

12

Containers

Main Container

• Main Storage• UUID as filename

Extended Container

• Thumbnail• Video Preview• Profile Photo

Page 13: Building a Personal Cloud Storage Service

13

Uploading a File

Client

Oracle DB

Transcoding

ImageMagickFFmpeg

SWIFT

Page 14: Building a Personal Cloud Storage Service

14

Temporary URL

Adding X-Auth-Token to the request header

not possible for all cases

Temporary URLfrom security perspective

Our Usage Cases

Page 15: Building a Personal Cloud Storage Service

15

Our Usage

33 OpenStack Servers

3.3 PB Storage Space

6 M Daily File Upload

1.6 B Total Files

Page 16: Building a Personal Cloud Storage Service

OpenStack MiddlewareCustom middleware modules

Page 17: Building a Personal Cloud Storage Service

17

Keystone

Business & OpenStackmust be use the sameauthentication token

Several authentication methods

Turkcell Auth, Mobile Network Auth, Remember Me, etc.

Authentication methodsshould be

easily extensible

Solution for these casesnot easy

on Keystone Side

Custom Keystone Middleware

authenticates via

RESTful API

Page 18: Building a Personal Cloud Storage Service

18

Keystone

No need to accessKeystone

from Internet

CallKeystone Auth APIfrom Business API

Page 19: Building a Personal Cloud Storage Service

19

Authentication

API- BUSINESS -

Keystone- OPENSTACK -

Authenticate User- BUSINESS -

Token Cache- BUSINESS -

USER- CLIENT -

Page 20: Building a Personal Cloud Storage Service

20

SWIFT

Client Sync Middleware

Notification MiddlewareSecurity Middleware

Page 21: Building a Personal Cloud Storage Service

21

SWIFT – Notification Middleware

Notify BACKEND

about file uploads

No failure

any uploaded fileyet

Transfer notificationsover RabbitMQ

Python Kombu

Get custom paramsusing X-Object-Meta-*

headers

Only forMain Container

Page 22: Building a Personal Cloud Storage Service

22

SWIFT – Security Middleware Open Internet

MAIN

Only GET requestsare allowed

EXTENDED

Define IP Blocks ofInternal Servers

in conf file

Reject invalidPUT requests

( X-Object-Meta-File-Name header required )

Allow onlyOBJECT operations

BlockACCOUNT & CONTAINER

operations

Only PUT, GET & OPTIONS requests are allowed

Page 23: Building a Personal Cloud Storage Service

23

SWIFT – Client Sync Middleware

PUT

X-Meta-Strategy:0 Check for conflict

1 Override existing object

X-Meta-Recent-Server-Hash:Known ETag value of object on the server

X-Meta-Recent-Server-Hash & ETag :

equals no conflict, allow PUT request and update existing one

not equals conflict, return bad response with status

USER- CLIENT -

Page 24: Building a Personal Cloud Storage Service

File SystemAdvantages of using custom filesystem on DB instead of SWIFT Object Paths & Container Listing

Page 25: Building a Personal Cloud Storage Service

25

File System

All Objectslocated under root path of

the container

Object NamesUUIDs

Display NameMetadata Header

File ListingsOracle DB

Photo & Video ListingElasticSearch Unified (Metadata) Search

ElasticSearch

Page 26: Building a Personal Cloud Storage Service

26

Difficulties of SWIFT File System

File Statisticsuser and/or content based file

statistics

New Featuresadding new features to

the filesystem

Pseudo Folder (Virtual)renaming a folder requires copying all sub-objects and

deleting old files – costlyDropbox & Google Drive

Page 27: Building a Personal Cloud Storage Service

27

Conclusion

Developed a Personal Cloud Storage Servicejust in 6 months

from scratchNo critical security

issue is found

tested multiple times by the internal & independent security organizations

No vendor lock-inhardware / software

HighlyScalable & Extendable

Page 28: Building a Personal Cloud Storage Service

DemonstrationFinal Product

Page 29: Building a Personal Cloud Storage Service

29

Page 30: Building a Personal Cloud Storage Service

30

Page 31: Building a Personal Cloud Storage Service

31

Page 32: Building a Personal Cloud Storage Service

32

Page 33: Building a Personal Cloud Storage Service

33

?https://akillidepo.turkcell.com.tr

Turkcell Akıllı Depo