Building Scalable Web Apps with Google App Engine. Brett Slatkin June 14, 2008

Size: px
Start display at page:

Download "Building Scalable Web Apps with Google App Engine. Brett Slatkin June 14, 2008"

Transcription

1 Building Scalable Web Apps with Google App Engine Brett Slatkin June 14, 2008

2 Agenda Using the Python runtime effectively Numbers everyone should know Tools for storing and scaling large data sets Example: Distributed counters Example: A blog

3 Prevent repeated, wasteful work

4 Prevent repeated, wasteful work Loading Python modules on every request can be slow Reuse main() to addresses this: def main(): wsgiref.handlers.cgihandler().run(my_app) if name == " main ": main() Lazy-load big modules to reduce the "warm-up" cost def my_expensive_operation(): import big_module big_module.do_work() Take advantage of "preloaded" modules

5 Prevent repeated, wasteful work 2 Avoid large result sets In-memory sorting and filtering can be slow Make the Datastore work for you Avoid repeated queries Landing pages that use the same query for everyone Incoherent caching Use memcache for a consistent view: results = memcache.get('main_results') if results is None: results = db.gqlquery('...').fetch(10) memcache.add('main_results', results, 60)

6 Numbers everyone should know

7 Numbers everyone should know Writes are expensive! Datastore is transactional: writes require disk access Disk access means disk seeks Rule of thumb: 10ms for a disk seek Simple math: 1s / 10ms = 100 seeks/sec maximum Depends on: The size and shape of your data Doing work in batches (batch puts and gets)

8 Numbers everyone should know 2 Reads are cheap! Reads do not need to be transactional, just consistent Data is read from disk once, then it's easily cached All subsequent reads come straight from memory Rule of thumb: 250usec for 1MB of data from memory Simple math: 1s / 250usec = 4GB/sec maximum For a 1MB entity, that's 4000 fetches/sec

9 Tools for storing data

10 Tools for storing data: Entities Fundamental storage type in App Engine Schemaless Set of property name/value pairs Most properties indexed and efficient to query Other large properties not indexed (Blobs, Text) Think of it as an object store, not relational Kinds are like classes Entities are like object instances Relationship between Entities using Keys Reference properties One to many, many to many

11 Tools for storing data: Keys Key corresponds to the Bigtable row for an Entity Bigtable accessible as a distributed hashtable Get() by Key: Very fast! No scanning, just copying data Limitations: Only one ID or key_name per Entity Cannot change ID or key_name later 500 bytes

12 Tools for storing data: Transactions ACID transactions Atomicity, Consistency, Isolation, Durability No queries in transactions Transactional read and write with Get() and Put() Common practice Query, find what you need Transact with Get() and Put() How to provide a consistent view in queries?

13 Tools for storing data: Entity groups Closely related Entities can form an Entity group Stored logically/physically close to each other Define your transactionality RDBMS: Row and table locking Datastore: Transactions across a single Entity group "Locking" one Entity in a group locks them all Serialized writes to the whole group (in transactions) Not a traditional lock; writers attempt to complete in parallel

14 Tools for storing data: Entity groups 2 Hierarchical Each Entity may have a parent A "root" node defines an Entity group Hierarchy of child Entities can go many levels deep Watch out! Serialized writes for all children of the root Datastore scales wide Each Entity group has serialized writes No limit to the number of Entity groups to use in parallel Think of it as many independent hierarchies of data

15 Tools for storing data: Entity groups 3 Entity groups all transacting in parallel: Root Root Root Root Child Child Child Child Txn 1 Txn 2 Txn 3 Txn 4

16 Tools for storing data: Entity groups 4 Pitfalls Large Entity groups = high contention = failed transactions Not thinking about write throughput is bad Structure your data to match your usage patterns Good news Query across entity groups without serialized access! Consistent view across all entity groups No partial commits visible All Entities in a group are the latest committed version

17 Example: Counters

18 Counters Using Model.count() Bigtable doesn't know counts by design O(N); cannot be O(1); must scan every Entity row! Use an Entity with a count property: class Counter(db.Model): count = db.integerproperty() Frequent updates = high contention! Transactional writes are serialized and too slow Fundamental limitation of distributed systems

19 Counters: Before and after Single Sharded Counter Counter Counter Counter

20 Counters: Sharded Shard counters into multiple Entity groups Pick an Entity at random and update it transactionally Combine sharded Entities together on reads "Contention" reduced by 1/N Sharding factor can be changed with little difficulty

21 Counters: Models class CounterConfig(Model): name = StringProperty(required=True) num_shards = IntegerProperty(required=True, default=1) class Counter(Model): name = StringProperty(required=True) count = IntegerProperty(required=True, default=0)

22 Counters: Get the count def get_count(name): total = 0 for counter in Counter.gql( 'WHERE name = :1', name): total += counter.count return total

23 Counters: Increment the count def increment(name): config = CounterConfig.get_or_insert(name, name=name) def txn(): index = random.randint(0, config.num_shards - 1) shard_name = name + str(index) counter = Counter.get_by_key_name(shard_name) if counter is None: counter = Counter( key_name=shard_name, name=name) counter.count += 1 counter.put() db.run_in_transaction(txn)

24 Counters: Cache reads def get_count(name): total = memcache.get(name) if total is None: total = 0 for counter in Counter.gql( 'WHERE name = :1', name): total += counter.count memcache.add(name, str(total), 60) return total

25 Counters: Cache writes def increment(name): config = CounterConfig.get_or_insert(name, name=name) def txn(): index = random.randint(0, config.num_shards - 1) shard_name = name + str(index) counter = Counter.get_by_key_name(shard_name) if counter is None: counter = Counter(key_name=shard_name, name=name) counter.count += 1 counter.put() db.run_in_transaction(txn) memcache.incr(name)

26 Example: Building a Blog

27 Building a Blog Standard blog Multiple blog posts Each post has comments Efficient paging without using queries with offsets Remember, Bigtable doesn't know counts!

28 Building a Blog: Blog entries Blog entries with an index Having an index establishes a rigid ordering Index enables efficient paging This is a global counter, but it's okay Low write throughput of overall posts = no contention

29 Building a Blog: Models class GlobalIndex(db.Model): max_index = db.integerproperty(required=true, default=0) class BlogEntry(db.Model): index = db.integerproperty(required=true) title = db.stringproperty(required=true) body = db.textproperty(required=true)

30 Building a Blog: Posting an entry def post_entry(blogname, title, body): def txn(): blog_index = BlogIndex.get_by_key_name(blogname) if blog_index is None: blog_index = BlogIndex(key_name=blogname) new_index = blog_index.max_index blog_index.max_index += 1 blog_index.put() new_entry = BlogEntry( key_name=blogname + str(new_index), parent=blog_index, index=new_index, title=title, body=body) new_entry.put() db.run_in_transaction(txn)

31 Building a Blog: Posting an entry 2 Hierarchy of Entities: Blog Index Entry

32 Building a Blog: Getting one entry def get_entry(blogname, index): entry = BlogEntry.get_by_key_name( parent=key.from_path('blogindex', blogname), blogname + str(index)) return entry That's it! Super fast!

33 Building a Blog: Paging def get_entries(start_index): extra = None if start_index is None: entries = BlogEntry.gql( 'ORDER BY index DESC').fetch( POSTS_PER_PAGE + 1) else: start_index = int(start_index) entries = BlogEntry.gql( 'WHERE index <= :1 ORDER BY index DESC', start_index).fetch(posts_per_page + 1) if len(entries) > POSTS_PER_PAGE: extra = entries[-1] entries = entries[:posts_per_page] return entries, extra

34 Building a Blog: Comments High write-throughput Can't use a shared index Would like to order by post date Post dates aren't unique, so we can't use them to page: :11: Before :11: My post :11: This is another post :11: And one more post :11: The last post :11: After

35 Building a Blog: Comments High write-throughput Can't use a shared index Would like to order by post date Post dates aren't unique, so we can't use them to page: :11: Before :11: My post :11: This is another post :11: And one more post :11: The last post :11: After

36 Building a Blog: Composite properties Make our own composite string property: "post time user ID comment ID" Use a shared index for each user's comment ID Each index is in a separate Entity group Guaranteed a unique ordering, querying across entity groups: :11: brett 3 Before :11: jon 3 My post :11: jon 4 This is another post :11: ryan 4 And one more post :11: ryan 5 The last post :11: ryan 2 After

37 Building a Blog: Composite properties 2 High throughput because of parallelism User Index User Index User Index Comment Comment Comment

38 What to remember

39 What to remember Minimize Python runtime overhead Minimize waste Why Query when you can Get? Structure your data to match your load Optimize for low write contention Think about Entity groups Memcache is awesome-- use it!

40 Learn more code.google.com

41

App Engine: Datastore Introduction

App Engine: Datastore Introduction App Engine: Datastore Introduction Part 1 Another very useful course: https://www.udacity.com/course/developing-scalableapps-in-java--ud859 1 Topics cover in this lesson What is Datastore? Datastore and

More information

Building scalable, complex apps on App Engine. Brett Slatkin May 27th, 2009

Building scalable, complex apps on App Engine. Brett Slatkin May 27th, 2009 Building scalable, complex apps on App Engine Brett Slatkin May 27th, 2009 Agenda List properties What they are, how they work Example: Microblogging Maximizing performance Merge-join What it is, how it

More information

Developing with Google App Engine

Developing with Google App Engine Developing with Google App Engine Dan Morrill, Developer Advocate Dan Morrill Google App Engine Slide 1 Developing with Google App Engine Introduction Dan Morrill Google App Engine Slide 2 Google App Engine

More information

App Engine MapReduce. Mike Aizatsky 11 May Hashtags: #io2011 #AppEngine Feedback:

App Engine MapReduce. Mike Aizatsky 11 May Hashtags: #io2011 #AppEngine Feedback: App Engine MapReduce Mike Aizatsky 11 May 2011 Hashtags: #io2011 #AppEngine Feedback: http://goo.gl/snv2i Agenda MapReduce Computational Model Mapper library Announcement Technical bits: Files API User-space

More information

big picture parallel db (one data center) mix of OLTP and batch analysis lots of data, high r/w rates, 1000s of cheap boxes thus many failures

big picture parallel db (one data center) mix of OLTP and batch analysis lots of data, high r/w rates, 1000s of cheap boxes thus many failures Lecture 20 -- 11/20/2017 BigTable big picture parallel db (one data center) mix of OLTP and batch analysis lots of data, high r/w rates, 1000s of cheap boxes thus many failures what does paper say Google

More information

Optimizing Your App Engine App

Optimizing Your App Engine App Optimizing Your App Engine App Marzia Niccolai Spender of GBucks Greg Darke Byte Herder Troy Trimble Professional Expert Agenda Overview Writing applications efficiently Datastore Tips Caching, Caching,

More information

CSE 530A. B+ Trees. Washington University Fall 2013

CSE 530A. B+ Trees. Washington University Fall 2013 CSE 530A B+ Trees Washington University Fall 2013 B Trees A B tree is an ordered (non-binary) tree where the internal nodes can have a varying number of child nodes (within some range) B Trees When a key

More information

Scalability of web applications

Scalability of web applications Scalability of web applications CSCI 470: Web Science Keith Vertanen Copyright 2014 Scalability questions Overview What's important in order to build scalable web sites? High availability vs. load balancing

More information

PNUTS and Weighted Voting. Vijay Chidambaram CS 380 D (Feb 8)

PNUTS and Weighted Voting. Vijay Chidambaram CS 380 D (Feb 8) PNUTS and Weighted Voting Vijay Chidambaram CS 380 D (Feb 8) PNUTS Distributed database built by Yahoo Paper describes a production system Goals: Scalability Low latency, predictable latency Must handle

More information

TRANSACTIONS AND ABSTRACTIONS

TRANSACTIONS AND ABSTRACTIONS TRANSACTIONS AND ABSTRACTIONS OVER HBASE Andreas Neumann @anew68! Continuuity AGENDA Transactions over HBase: Why? What? Implementation: How? The approach Transaction Manager Abstractions Future WHO WE

More information

Extreme Computing. NoSQL.

Extreme Computing. NoSQL. Extreme Computing NoSQL PREVIOUSLY: BATCH Query most/all data Results Eventually NOW: ON DEMAND Single Data Points Latency Matters One problem, three ideas We want to keep track of mutable state in a scalable

More information

Bigtable. Presenter: Yijun Hou, Yixiao Peng

Bigtable. Presenter: Yijun Hou, Yixiao Peng Bigtable Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson C. Hsieh, Deborah A. Wallach Mike Burrows, Tushar Chandra, Andrew Fikes, Robert E. Gruber Google, Inc. OSDI 06 Presenter: Yijun Hou, Yixiao Peng

More information

BigTable. Chubby. BigTable. Chubby. Why Chubby? How to do consensus as a service

BigTable. Chubby. BigTable. Chubby. Why Chubby? How to do consensus as a service BigTable BigTable Doug Woos and Tom Anderson In the early 2000s, Google had way more than anybody else did Traditional bases couldn t scale Want something better than a filesystem () BigTable optimized

More information

Distributed File Systems II

Distributed File Systems II Distributed File Systems II To do q Very-large scale: Google FS, Hadoop FS, BigTable q Next time: Naming things GFS A radically new environment NFS, etc. Independence Small Scale Variety of workloads Cooperation

More information

Indexing. Jan Chomicki University at Buffalo. Jan Chomicki () Indexing 1 / 25

Indexing. Jan Chomicki University at Buffalo. Jan Chomicki () Indexing 1 / 25 Indexing Jan Chomicki University at Buffalo Jan Chomicki () Indexing 1 / 25 Storage hierarchy Cache Main memory Disk Tape Very fast Fast Slower Slow (nanosec) (10 nanosec) (millisec) (sec) Very small Small

More information

Heckaton. SQL Server's Memory Optimized OLTP Engine

Heckaton. SQL Server's Memory Optimized OLTP Engine Heckaton SQL Server's Memory Optimized OLTP Engine Agenda Introduction to Hekaton Design Consideration High Level Architecture Storage and Indexing Query Processing Transaction Management Transaction Durability

More information

Distributed Data Store

Distributed Data Store Distributed Data Store Large-Scale Distributed le system Q: What if we have too much data to store in a single machine? Q: How can we create one big filesystem over a cluster of machines, whose data is

More information

Percona Live September 21-23, 2015 Mövenpick Hotel Amsterdam

Percona Live September 21-23, 2015 Mövenpick Hotel Amsterdam Percona Live 2015 September 21-23, 2015 Mövenpick Hotel Amsterdam TokuDB internals Percona team, Vlad Lesin, Sveta Smirnova Slides plan Introduction in Fractal Trees and TokuDB Files Block files Fractal

More information

Scaling App Engine Applications. Justin Haugh, Guido van Rossum May 10, 2011

Scaling App Engine Applications. Justin Haugh, Guido van Rossum May 10, 2011 Scaling App Engine Applications Justin Haugh, Guido van Rossum May 10, 2011 First things first Justin Haugh Software Engineer Systems Infrastructure jhaugh@google.com Guido Van Rossum Software Engineer

More information

Asynchronous View Maintenance for VLSD Databases

Asynchronous View Maintenance for VLSD Databases Asynchronous View Maintenance for VLSD Databases Parag Agrawal, Adam Silberstein, Brian F. Cooper, Utkarsh Srivastava, Raghu Ramakrishnan SIGMOD 2009 Talk by- Prashant S. Jaiswal Ketan J. Mav Motivation

More information

FLAT DATACENTER STORAGE CHANDNI MODI (FN8692)

FLAT DATACENTER STORAGE CHANDNI MODI (FN8692) FLAT DATACENTER STORAGE CHANDNI MODI (FN8692) OUTLINE Flat datacenter storage Deterministic data placement in fds Metadata properties of fds Per-blob metadata in fds Dynamic Work Allocation in fds Replication

More information

Storage hierarchy. Textbook: chapters 11, 12, and 13

Storage hierarchy. Textbook: chapters 11, 12, and 13 Storage hierarchy Cache Main memory Disk Tape Very fast Fast Slower Slow Very small Small Bigger Very big (KB) (MB) (GB) (TB) Built-in Expensive Cheap Dirt cheap Disks: data is stored on concentric circular

More information

Interactive Implicit Modeling with Hierarchical Spatial Caching

Interactive Implicit Modeling with Hierarchical Spatial Caching Interactive Implicit Modeling with Hierarchical Spatial Caching Ryan Schmidt 1, Brian Wyvill 1, Eric Galin 2 1 University of Calgary, Canada 2 LIRIS-CNRS, Université Claude Bernard Lyon 1, France Outline

More information

EECS 482 Introduction to Operating Systems

EECS 482 Introduction to Operating Systems EECS 482 Introduction to Operating Systems Winter 2018 Baris Kasikci Slides by: Harsha V. Madhyastha OS Abstractions Applications Threads File system Virtual memory Operating System Next few lectures:

More information

VOLTDB + HP VERTICA. page

VOLTDB + HP VERTICA. page VOLTDB + HP VERTICA ARCHITECTURE FOR FAST AND BIG DATA ARCHITECTURE FOR FAST + BIG DATA FAST DATA Fast Serve Analytics BIG DATA BI Reporting Fast Operational Database Streaming Analytics Columnar Analytics

More information

I/O and file systems. Dealing with device heterogeneity

I/O and file systems. Dealing with device heterogeneity I/O and file systems Abstractions provided by operating system for storage devices Heterogeneous -> uniform One/few storage objects (disks) -> many storage objects (files) Simple naming -> rich naming

More information

Bigtable: A Distributed Storage System for Structured Data. Andrew Hon, Phyllis Lau, Justin Ng

Bigtable: A Distributed Storage System for Structured Data. Andrew Hon, Phyllis Lau, Justin Ng Bigtable: A Distributed Storage System for Structured Data Andrew Hon, Phyllis Lau, Justin Ng What is Bigtable? - A storage system for managing structured data - Used in 60+ Google services - Motivation:

More information

Goal of the presentation is to give an introduction of NoSQL databases, why they are there.

Goal of the presentation is to give an introduction of NoSQL databases, why they are there. 1 Goal of the presentation is to give an introduction of NoSQL databases, why they are there. We want to present "Why?" first to explain the need of something like "NoSQL" and then in "What?" we go in

More information

Balanced Trees Part One

Balanced Trees Part One Balanced Trees Part One Balanced Trees Balanced search trees are among the most useful and versatile data structures. Many programming languages ship with a balanced tree library. C++: std::map / std::set

More information

Building Consistent Transactions with Inconsistent Replication

Building Consistent Transactions with Inconsistent Replication Building Consistent Transactions with Inconsistent Replication Irene Zhang, Naveen Kr. Sharma, Adriana Szekeres, Arvind Krishnamurthy, Dan R. K. Ports University of Washington Distributed storage systems

More information

Lecture 12. Lecture 12: The IO Model & External Sorting

Lecture 12. Lecture 12: The IO Model & External Sorting Lecture 12 Lecture 12: The IO Model & External Sorting Announcements Announcements 1. Thank you for the great feedback (post coming soon)! 2. Educational goals: 1. Tech changes, principles change more

More information

CS 310: Memory Hierarchy and B-Trees

CS 310: Memory Hierarchy and B-Trees CS 310: Memory Hierarchy and B-Trees Chris Kauffman Week 14-1 Matrix Sum Given an M by N matrix X, sum its elements M rows, N columns Sum R given X, M, N sum = 0 for i=0 to M-1{ for j=0 to N-1 { sum +=

More information

Chapter 4 File Systems. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Chapter 4 File Systems. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved Chapter 4 File Systems File Systems The best way to store information: Store all information in virtual memory address space Use ordinary memory read/write to access information Not feasible: no enough

More information

NoSQL Databases MongoDB vs Cassandra. Kenny Huynh, Andre Chik, Kevin Vu

NoSQL Databases MongoDB vs Cassandra. Kenny Huynh, Andre Chik, Kevin Vu NoSQL Databases MongoDB vs Cassandra Kenny Huynh, Andre Chik, Kevin Vu Introduction - Relational database model - Concept developed in 1970 - Inefficient - NoSQL - Concept introduced in 1980 - Related

More information

Ghislain Fourny. Big Data 5. Wide column stores

Ghislain Fourny. Big Data 5. Wide column stores Ghislain Fourny Big Data 5. Wide column stores Data Technology Stack User interfaces Querying Data stores Indexing Processing Validation Data models Syntax Encoding Storage 2 Where we are User interfaces

More information

FLAT DATACENTER STORAGE. Paper-3 Presenter-Pratik Bhatt fx6568

FLAT DATACENTER STORAGE. Paper-3 Presenter-Pratik Bhatt fx6568 FLAT DATACENTER STORAGE Paper-3 Presenter-Pratik Bhatt fx6568 FDS Main discussion points A cluster storage system Stores giant "blobs" - 128-bit ID, multi-megabyte content Clients and servers connected

More information

Big Table. Google s Storage Choice for Structured Data. Presented by Group E - Dawei Yang - Grace Ramamoorthy - Patrick O Sullivan - Rohan Singla

Big Table. Google s Storage Choice for Structured Data. Presented by Group E - Dawei Yang - Grace Ramamoorthy - Patrick O Sullivan - Rohan Singla Big Table Google s Storage Choice for Structured Data Presented by Group E - Dawei Yang - Grace Ramamoorthy - Patrick O Sullivan - Rohan Singla Bigtable: Introduction Resembles a database. Does not support

More information

MONGODB INTERVIEW QUESTIONS

MONGODB INTERVIEW QUESTIONS MONGODB INTERVIEW QUESTIONS http://www.tutorialspoint.com/mongodb/mongodb_interview_questions.htm Copyright tutorialspoint.com Dear readers, these MongoDB Interview Questions have been designed specially

More information

Lecture 10: Crash Recovery, Logging

Lecture 10: Crash Recovery, Logging 6.828 2011 Lecture 10: Crash Recovery, Logging what is crash recovery? you're writing the file system then the power fails you reboot is your file system still useable? the main problem: crash during multi-step

More information

Developing Solutions for Google Cloud Platform (CPD200) Course Agenda

Developing Solutions for Google Cloud Platform (CPD200) Course Agenda Developing Solutions for Google Cloud Platform (CPD200) Course Agenda Module 1: Developing Solutions for Google Cloud Platform Identify the advantages of Google Cloud Platform for solution development

More information

Layers. External Level Conceptual Level Internal Level

Layers. External Level Conceptual Level Internal Level Layers External Level Conceptual Level Internal Level Objective of 3 Layer Arch. Separate each user s view of database from the way database is physically represented. Each user should be able to access

More information

CSC 261/461 Database Systems Lecture 20. Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101

CSC 261/461 Database Systems Lecture 20. Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101 CSC 261/461 Database Systems Lecture 20 Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101 Announcements Project 1 Milestone 3: Due tonight Project 2 Part 2 (Optional): Due on: 04/08 Project 3

More information

Midterm Exam Solutions Amy Murphy 28 February 2001

Midterm Exam Solutions Amy Murphy 28 February 2001 University of Rochester Midterm Exam Solutions Amy Murphy 8 February 00 Computer Systems (CSC/56) Read before beginning: Please write clearly. Illegible answers cannot be graded. Be sure to identify all

More information

Readings and References. Virtual Memory. Virtual Memory. Virtual Memory VPN. Reading. CSE Computer Systems December 5, 2001.

Readings and References. Virtual Memory. Virtual Memory. Virtual Memory VPN. Reading. CSE Computer Systems December 5, 2001. Readings and References Virtual Memory Reading Chapter through.., Operating System Concepts, Silberschatz, Galvin, and Gagne CSE - Computer Systems December, Other References Chapter, Inside Microsoft

More information

ò Very reliable, best-of-breed traditional file system design ò Much like the JOS file system you are building now

ò Very reliable, best-of-breed traditional file system design ò Much like the JOS file system you are building now Ext2 review Very reliable, best-of-breed traditional file system design Ext3/4 file systems Don Porter CSE 506 Much like the JOS file system you are building now Fixed location super blocks A few direct

More information

The MySQL Query Cache

The MySQL Query Cache The MySQL Query Cache Baron Schwartz Percona Inc -2- The Roadmap How it works What it isn't Myths How it uses memory Monitoring and status Configuration Trivia (how it works with InnoDB) What is the Query

More information

The Google File System

The Google File System The Google File System Sanjay Ghemawat, Howard Gobioff, and Shun-Tak Leung SOSP 2003 presented by Kun Suo Outline GFS Background, Concepts and Key words Example of GFS Operations Some optimizations in

More information

Transactions and ACID

Transactions and ACID Transactions and ACID Kevin Swingler Contents Recap of ACID transactions in RDBMSs Transactions and ACID in MongoDB 1 Concurrency Databases are almost always accessed by multiple users concurrently A user

More information

Introduction to NoSQL Databases

Introduction to NoSQL Databases Introduction to NoSQL Databases Roman Kern KTI, TU Graz 2017-10-16 Roman Kern (KTI, TU Graz) Dbase2 2017-10-16 1 / 31 Introduction Intro Why NoSQL? Roman Kern (KTI, TU Graz) Dbase2 2017-10-16 2 / 31 Introduction

More information

Cassandra, MongoDB, and HBase. Cassandra, MongoDB, and HBase. I have chosen these three due to their recent

Cassandra, MongoDB, and HBase. Cassandra, MongoDB, and HBase. I have chosen these three due to their recent Tanton Jeppson CS 401R Lab 3 Cassandra, MongoDB, and HBase Introduction For my report I have chosen to take a deeper look at 3 NoSQL database systems: Cassandra, MongoDB, and HBase. I have chosen these

More information

Google GCP-Solution Architects Exam

Google GCP-Solution Architects Exam Volume: 90 Questions Question: 1 Regarding memcache which of the options is an ideal use case? A. Caching data that isn't accessed often B. Caching data that is written more than it's read C. Caching important

More information

Cloud Spanner. Rohit Gupta, Solutions

Cloud Spanner. Rohit Gupta, Solutions Cloud Spanner Rohit Gupta, Solutions Engineer @rohitforcloud Today s goals Provide a brief history of Spanner at Google Provide an explanation of Cloud Spanner Do a demo! Built on the same infrastructure

More information

CSE332: Data Abstractions Lecture 7: B Trees. James Fogarty Winter 2012

CSE332: Data Abstractions Lecture 7: B Trees. James Fogarty Winter 2012 CSE2: Data Abstractions Lecture 7: B Trees James Fogarty Winter 20 The Dictionary (a.k.a. Map) ADT Data: Set of (key, value) pairs keys must be comparable insert(jfogarty,.) Operations: insert(key,value)

More information

Bigtable: A Distributed Storage System for Structured Data By Fay Chang, et al. OSDI Presented by Xiang Gao

Bigtable: A Distributed Storage System for Structured Data By Fay Chang, et al. OSDI Presented by Xiang Gao Bigtable: A Distributed Storage System for Structured Data By Fay Chang, et al. OSDI 2006 Presented by Xiang Gao 2014-11-05 Outline Motivation Data Model APIs Building Blocks Implementation Refinement

More information

Bases de Dades: introduction to SQL (indexes and transactions)

Bases de Dades: introduction to SQL (indexes and transactions) Bases de Dades: introduction to SQL (indexes and transactions) Andrew D. Bagdanov bagdanov@cvc.uab.es Departamento de Ciencias de la Computación Universidad Autónoma de Barcelona Fall, 2010 Questions from

More information

Last Class Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications

Last Class Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications Last Class Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB Applications Basic Timestamp Ordering Optimistic Concurrency Control Multi-Version Concurrency Control C. Faloutsos A. Pavlo Lecture#23:

More information

CSE-E5430 Scalable Cloud Computing Lecture 9

CSE-E5430 Scalable Cloud Computing Lecture 9 CSE-E5430 Scalable Cloud Computing Lecture 9 Keijo Heljanko Department of Computer Science School of Science Aalto University keijo.heljanko@aalto.fi 15.11-2015 1/24 BigTable Described in the paper: Fay

More information

Scaling Without Sharding. Baron Schwartz Percona Inc Surge 2010

Scaling Without Sharding. Baron Schwartz Percona Inc Surge 2010 Scaling Without Sharding Baron Schwartz Percona Inc Surge 2010 Web Scale!!!! http://www.xtranormal.com/watch/6995033/ A Sharding Thought Experiment 64 shards per proxy [1] 1 TB of data storage per node

More information

Big Data Technology Incremental Processing using Distributed Transactions

Big Data Technology Incremental Processing using Distributed Transactions Big Data Technology Incremental Processing using Distributed Transactions Eshcar Hillel Yahoo! Ronny Lempel Outbrain *Based on slides by Edward Bortnikov and Ohad Shacham Roadmap Previous classes Stream

More information

GFS Overview. Design goals/priorities Design for big-data workloads Huge files, mostly appends, concurrency, huge bandwidth Design for failures

GFS Overview. Design goals/priorities Design for big-data workloads Huge files, mostly appends, concurrency, huge bandwidth Design for failures GFS Overview Design goals/priorities Design for big-data workloads Huge files, mostly appends, concurrency, huge bandwidth Design for failures Interface: non-posix New op: record appends (atomicity matters,

More information

CSE506: Operating Systems CSE 506: Operating Systems

CSE506: Operating Systems CSE 506: Operating Systems CSE 506: Operating Systems File Systems Traditional File Systems FS, UFS/FFS, Ext2, Several simple on disk structures Superblock magic value to identify filesystem type Places to find metadata on disk

More information

Data Modeling and Databases Ch 14: Data Replication. Gustavo Alonso, Ce Zhang Systems Group Department of Computer Science ETH Zürich

Data Modeling and Databases Ch 14: Data Replication. Gustavo Alonso, Ce Zhang Systems Group Department of Computer Science ETH Zürich Data Modeling and Databases Ch 14: Data Replication Gustavo Alonso, Ce Zhang Systems Group Department of Computer Science ETH Zürich Database Replication What is database replication The advantages of

More information

TRANSACTION MANAGEMENT

TRANSACTION MANAGEMENT TRANSACTION MANAGEMENT CS 564- Spring 2018 ACKs: Jeff Naughton, Jignesh Patel, AnHai Doan WHAT IS THIS LECTURE ABOUT? Transaction (TXN) management ACID properties atomicity consistency isolation durability

More information

Big Data Infrastructure CS 489/698 Big Data Infrastructure (Winter 2017)

Big Data Infrastructure CS 489/698 Big Data Infrastructure (Winter 2017) Big Data Infrastructure CS 489/698 Big Data Infrastructure (Winter 2017) Week 10: Mutable State (1/2) March 14, 2017 Jimmy Lin David R. Cheriton School of Computer Science University of Waterloo These

More information

Database Architectures

Database Architectures Database Architectures CPS352: Database Systems Simon Miner Gordon College Last Revised: 4/15/15 Agenda Check-in Parallelism and Distributed Databases Technology Research Project Introduction to NoSQL

More information

Ext3/4 file systems. Don Porter CSE 506

Ext3/4 file systems. Don Porter CSE 506 Ext3/4 file systems Don Porter CSE 506 Logical Diagram Binary Formats Memory Allocators System Calls Threads User Today s Lecture Kernel RCU File System Networking Sync Memory Management Device Drivers

More information

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Last Class. Today s Class. Faloutsos/Pavlo CMU /615

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Last Class. Today s Class. Faloutsos/Pavlo CMU /615 Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB Applications C. Faloutsos A. Pavlo Lecture#23: Crash Recovery Part 1 (R&G ch. 18) Last Class Basic Timestamp Ordering Optimistic Concurrency

More information

Large-Scale Web Applications

Large-Scale Web Applications Large-Scale Web Applications Mendel Rosenblum Web Application Architecture Web Browser Web Server / Application server Storage System HTTP Internet CS142 Lecture Notes - Intro LAN 2 Large-Scale: Scale-Out

More information

Outline. Database Management and Tuning. Outline. Join Strategies Running Example. Index Tuning. Johann Gamper. Unit 6 April 12, 2012

Outline. Database Management and Tuning. Outline. Join Strategies Running Example. Index Tuning. Johann Gamper. Unit 6 April 12, 2012 Outline Database Management and Tuning Johann Gamper Free University of Bozen-Bolzano Faculty of Computer Science IDSE Unit 6 April 12, 2012 1 Acknowledgements: The slides are provided by Nikolaus Augsten

More information

DATABASE TRANSACTIONS. CS121: Relational Databases Fall 2017 Lecture 25

DATABASE TRANSACTIONS. CS121: Relational Databases Fall 2017 Lecture 25 DATABASE TRANSACTIONS CS121: Relational Databases Fall 2017 Lecture 25 Database Transactions 2 Many situations where a sequence of database operations must be treated as a single unit A combination of

More information

NoSQL Databases. Amir H. Payberah. Swedish Institute of Computer Science. April 10, 2014

NoSQL Databases. Amir H. Payberah. Swedish Institute of Computer Science. April 10, 2014 NoSQL Databases Amir H. Payberah Swedish Institute of Computer Science amir@sics.se April 10, 2014 Amir H. Payberah (SICS) NoSQL Databases April 10, 2014 1 / 67 Database and Database Management System

More information

Consistent deals with integrity constraints, which we are not going to talk about.

Consistent deals with integrity constraints, which we are not going to talk about. Transactions Model: Begin xact Sql-1 Sql-2 Sql-n commit or abort Concurrency control (Isolation) Crash recovery (Atomic, Durable) Example: move $100 from acct-a to acct-b Atomic: all or nothing Durable:

More information

User Perspective. Module III: System Perspective. Module III: Topics Covered. Module III Overview of Storage Structures, QP, and TM

User Perspective. Module III: System Perspective. Module III: Topics Covered. Module III Overview of Storage Structures, QP, and TM Module III Overview of Storage Structures, QP, and TM Sharma Chakravarthy UT Arlington sharma@cse.uta.edu http://www2.uta.edu/sharma base Management Systems: Sharma Chakravarthy Module I Requirements analysis

More information

Realtime visitor analysis with Couchbase and Elasticsearch

Realtime visitor analysis with Couchbase and Elasticsearch Realtime visitor analysis with Couchbase and Elasticsearch Jeroen Reijn @jreijn #nosql13 About me Jeroen Reijn Software engineer Hippo @jreijn http://blog.jeroenreijn.com About Hippo Visitor Analysis OneHippo

More information

The Right Read Optimization is Actually Write Optimization. Leif Walsh

The Right Read Optimization is Actually Write Optimization. Leif Walsh The Right Read Optimization is Actually Write Optimization Leif Walsh leif@tokutek.com The Right Read Optimization is Write Optimization Situation: I have some data. I want to learn things about the world,

More information

Ghislain Fourny. Big Data 5. Column stores

Ghislain Fourny. Big Data 5. Column stores Ghislain Fourny Big Data 5. Column stores 1 Introduction 2 Relational model 3 Relational model Schema 4 Issues with relational databases (RDBMS) Small scale Single machine 5 Can we fix a RDBMS? Scale up

More information

Top 10 Essbase Optimization Tips that Give You 99+% Improvements

Top 10 Essbase Optimization Tips that Give You 99+% Improvements Top 10 Essbase Optimization Tips that Give You 99+% Improvements Edward Roske info@interrel.com BLOG: LookSmarter.blogspot.com WEBSITE: www.interrel.com TWITTER: Eroske 3 About interrel Reigning Oracle

More information

Scaling for Humongous amounts of data with MongoDB

Scaling for Humongous amounts of data with MongoDB Scaling for Humongous amounts of data with MongoDB Alvin Richards Technical Director, EMEA alvin@10gen.com @jonnyeight alvinonmongodb.com From here... http://bit.ly/ot71m4 ...to here... http://bit.ly/oxcsis

More information

Workshop Report: ElaStraS - An Elastic Transactional Datastore in the Cloud

Workshop Report: ElaStraS - An Elastic Transactional Datastore in the Cloud Workshop Report: ElaStraS - An Elastic Transactional Datastore in the Cloud Sudipto Das, Divyakant Agrawal, Amr El Abbadi Report by: Basil Kohler January 4, 2013 Prerequisites This report elaborates and

More information

PaaS Cloud mit Java. Eberhard Wolff, Principal Technologist, SpringSource A division of VMware VMware Inc. All rights reserved

PaaS Cloud mit Java. Eberhard Wolff, Principal Technologist, SpringSource A division of VMware VMware Inc. All rights reserved PaaS Cloud mit Java Eberhard Wolff, Principal Technologist, SpringSource A division of VMware 2009 VMware Inc. All rights reserved Agenda! A Few Words About Cloud! PaaS Platform as a Service! Google App

More information

CS 318 Principles of Operating Systems

CS 318 Principles of Operating Systems CS 318 Principles of Operating Systems Fall 2017 Lecture 16: File Systems Examples Ryan Huang File Systems Examples BSD Fast File System (FFS) - What were the problems with the original Unix FS? - How

More information

File Systems. CS 4410 Operating Systems. [R. Agarwal, L. Alvisi, A. Bracy, M. George, E. Sirer, R. Van Renesse]

File Systems. CS 4410 Operating Systems. [R. Agarwal, L. Alvisi, A. Bracy, M. George, E. Sirer, R. Van Renesse] File Systems CS 4410 Operating Systems [R. Agarwal, L. Alvisi, A. Bracy, M. George, E. Sirer, R. Van Renesse] The abstraction stack I/O systems are accessed through a series of layered abstractions Application

More information

CS 318 Principles of Operating Systems

CS 318 Principles of Operating Systems CS 318 Principles of Operating Systems Fall 2018 Lecture 16: Advanced File Systems Ryan Huang Slides adapted from Andrea Arpaci-Dusseau s lecture 11/6/18 CS 318 Lecture 16 Advanced File Systems 2 11/6/18

More information

CISC 7610 Lecture 2b The beginnings of NoSQL

CISC 7610 Lecture 2b The beginnings of NoSQL CISC 7610 Lecture 2b The beginnings of NoSQL Topics: Big Data Google s infrastructure Hadoop: open google infrastructure Scaling through sharding CAP theorem Amazon s Dynamo 5 V s of big data Everyone

More information

Goals. Facebook s Scaling Problem. Scaling Strategy. Facebook Three Layer Architecture. Workload. Memcache as a Service.

Goals. Facebook s Scaling Problem. Scaling Strategy. Facebook Three Layer Architecture. Workload. Memcache as a Service. Goals Memcache as a Service Tom Anderson Rapid application development - Speed of adding new features is paramount Scale Billions of users Every user on FB all the time Performance Low latency for every

More information

InnoDB: Status, Architecture, and Latest Enhancements

InnoDB: Status, Architecture, and Latest Enhancements InnoDB: Status, Architecture, and Latest Enhancements O'Reilly MySQL Conference, April 14, 2011 Inaam Rana, Oracle John Russell, Oracle Bios Inaam Rana (InnoDB / MySQL / Oracle) Crash recovery speedup

More information

Preview. Memory Management

Preview. Memory Management Preview Memory Management With Mono-Process With Multi-Processes Multi-process with Fixed Partitions Modeling Multiprogramming Swapping Memory Management with Bitmaps Memory Management with Free-List Virtual

More information

JOURNALING FILE SYSTEMS. CS124 Operating Systems Winter , Lecture 26

JOURNALING FILE SYSTEMS. CS124 Operating Systems Winter , Lecture 26 JOURNALING FILE SYSTEMS CS124 Operating Systems Winter 2015-2016, Lecture 26 2 File System Robustness The operating system keeps a cache of filesystem data Secondary storage devices are much slower than

More information

Rethinking Serializable Multi-version Concurrency Control. Jose Faleiro and Daniel Abadi Yale University

Rethinking Serializable Multi-version Concurrency Control. Jose Faleiro and Daniel Abadi Yale University Rethinking Serializable Multi-version Concurrency Control Jose Faleiro and Daniel Abadi Yale University Theory: Single- vs Multi-version Systems Single-version system T r Read X X 0 T w Write X Multi-version

More information

COMP 3430 Robert Guderian

COMP 3430 Robert Guderian Operating Systems COMP 3430 Robert Guderian file:///users/robg/dropbox/teaching/3430-2018/slides/04_threads/index.html?print-pdf#/ 1/58 1 Threads Last week: Processes This week: Lesser processes! file:///users/robg/dropbox/teaching/3430-2018/slides/04_threads/index.html?print-pdf#/

More information

Consistency Without Transactions Global Family Tree

Consistency Without Transactions Global Family Tree Consistency Without Transactions Global Family Tree NoSQL Matters Cologne Spring 2014 2014 by Intellectual Reserve, Inc. All rights reserved. 1 Contents Introduction to FamilySearch Family Tree Motivation

More information

Topics. History. Architecture. MongoDB, Mongoose - RDBMS - SQL. - NoSQL

Topics. History. Architecture. MongoDB, Mongoose - RDBMS - SQL. - NoSQL Databases Topics History - RDBMS - SQL Architecture - SQL - NoSQL MongoDB, Mongoose Persistent Data Storage What features do we want in a persistent data storage system? We have been using text files to

More information

The Google File System

The Google File System October 13, 2010 Based on: S. Ghemawat, H. Gobioff, and S.-T. Leung: The Google file system, in Proceedings ACM SOSP 2003, Lake George, NY, USA, October 2003. 1 Assumptions Interface Architecture Single

More information

10 Million Smart Meter Data with Apache HBase

10 Million Smart Meter Data with Apache HBase 10 Million Smart Meter Data with Apache HBase 5/31/2017 OSS Solution Center Hitachi, Ltd. Masahiro Ito OSS Summit Japan 2017 Who am I? Masahiro Ito ( 伊藤雅博 ) Software Engineer at Hitachi, Ltd. Focus on

More information

A tomicity: All actions in the Xact happen, or none happen. D urability: If a Xact commits, its effects persist.

A tomicity: All actions in the Xact happen, or none happen. D urability: If a Xact commits, its effects persist. Review: The ACID properties A tomicity: All actions in the Xact happen, or none happen. Logging and Recovery C onsistency: If each Xact is consistent, and the DB starts consistent, it ends up consistent.

More information

Rule 14 Use Databases Appropriately

Rule 14 Use Databases Appropriately Rule 14 Use Databases Appropriately Rule 14: What, When, How, and Why What: Use relational databases when you need ACID properties to maintain relationships between your data. For other data storage needs

More information

CS122 Lecture 15 Winter Term,

CS122 Lecture 15 Winter Term, CS122 Lecture 15 Winter Term, 2017-2018 2 Transaction Processing Last time, introduced transaction processing ACID properties: Atomicity, consistency, isolation, durability Began talking about implementing

More information

TiDB: NewSQL over HBase.

TiDB: NewSQL over HBase. TiDB: NewSQL over HBase liuqi@pingcap.com https://github.com/pingcap/tidb weibo: @goroutine Agenda HBase introduction TiDB features Internals of TiDB over HBase Features of HBase Linear and modular scalability.

More information

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part II: Data Center Software Architecture: Topic 1: Distributed File Systems GFS (The Google File System) 1 Filesystems

More information

Copyright 2013, Oracle and/or its affiliates. All rights reserved.

Copyright 2013, Oracle and/or its affiliates. All rights reserved. 1 Oracle NoSQL Database: Release 3.0 What s new and why you care Dave Segleau NoSQL Product Manager The following is intended to outline our general product direction. It is intended for information purposes

More information