SlideShare ist ein Scribd-Unternehmen logo
1 von 16
BigQueue
A Big, Fast and Persistent
Queue
    - by William
    http://bulldog2011.github.com/
Feature Highlights
   Fast
         enqueue and dequeue are close to O(1) direct memory access.
   Big
         Only limited by available disk space.
   Persistent
         Data is persisted on disk and is crash resistant.
   Reliable
         OS will be responsible for message persistence even your process crashes.
   Realtime
         Produced messages will be immediately visible to consumers
   Flexible Queue Semantics
         Consume once queue, fanout queue, can even consume by index
   Memory-efficient
         Automatic pagging & swapping algorithm, only most recently accessed data is kept in memory.
   Thread-safe
         Multiple threads can concurrently enqueue and dequeue without data corruption.
   Simple & Light-weight
         Current library jar is less than 40K.
Performance Highlights

   In concurrent producing and consuming case,
    average throughput is around 166MBps.
   In sequential producing then consuming case,
    average throughput is around 333MBps.
Design – Logical View

   Looks just like a big array or a circular array
Design – Consume Once and Fanout
Semantics Support
Design – Physical View : Paged Index +
Data File
Design – Components View
Design – Dynamic View :
Memory Mapped Sliding Window
Concurrency

   Produce(or append) is synchronized in the
    queue implementation
   Consume(or read) is already thread-safe
Simple Interface

   Creation
    IBigQueue bigQueue = new BigQueueImpl("d:/bigqueue/tutorial",
    "demo");
   Enqueue
     for(int i = 0; i < 10; i++) {
        String item = String.valueOf(i);
        bigQueue.enqueue(item.getBytes());
    }
   Dequeue
    for(int i = 0; i < 5; i++) {
      String item = new String(bigQueue.dequeue());
    }
   Peek
     byte[] data = bigQueue.peek();
Fanout Queue
   Creation
    IFanOutQueue foQueue = new FanOutQueueImpl("d:/tutorial/fanout-queue", "demo");
   Enqueue
     for(int i = 0; i < 10; i++) {
       String log = "log-" + i;
       foQueue.enqueue(log.getBytes());
    }
   Fanout 1 Dequeue
    String fanoutId1 = "realtime";
    while(!foQueue.isEmpty(fanoutId1)) {
        String item = new String(foQueue.dequeue(fanoutId1));
        System.out.println(item);
    }
   Fanout 2 Dequeue
    String fanoutId2 = "offline";
    while(!foQueue.isEmpty(fanoutId2)) {
        String item = new String(foQueue.dequeue(fanoutId2));
        System.out.println(item);
    }
    Fanout 1 and Fanout 2 consuming are independent
Fanout Queue Semantics
Use Case 1 :
Log Collecting & Consuming
Use Case 2 :
Big Data Sorting
        Queue Only Algorithm:
    1.     Put all data into a source queue
    2.     Build a queueOfSortedQueues by dividing and
           sorting the source queue
    3.     Merge sort the queueOfSortedQueues
    4.     The last one left in the queueOfSortedQueues
           is the final sorted queue
Source, Samples, Docs and Tutorials


    https://github.com/bulldog2011/bigqueue
Other Alternatives

   Apache ActiveMQ
       http://activemq.apache.org
   RabbitMQ
       http://www.rabbitmq.com/
   ZeroMQ
       http://www.zeromq.org
   Kestrel
       https://github.com/robey/kestrel
   Apache Kafka
       http://kafka.apache.org

Weitere ähnliche Inhalte

Was ist angesagt?

ManageEngine ADAudit Plus
ManageEngine ADAudit PlusManageEngine ADAudit Plus
ManageEngine ADAudit PlusMajd Khriema
 
Database backup & recovery
Database backup & recoveryDatabase backup & recovery
Database backup & recoveryMustafa Khan
 
Tips and Tricks for SAP Sybase ASE
Tips and Tricks for SAP Sybase ASETips and Tricks for SAP Sybase ASE
Tips and Tricks for SAP Sybase ASEDon Brizendine
 
Sql parametrized queries
Sql parametrized queriesSql parametrized queries
Sql parametrized queriesHadi Fadlallah
 
Exadata_X10M-Hardware-Overview.pdf
Exadata_X10M-Hardware-Overview.pdfExadata_X10M-Hardware-Overview.pdf
Exadata_X10M-Hardware-Overview.pdfKoko842772
 
Physical architecture of sql server
Physical architecture of sql serverPhysical architecture of sql server
Physical architecture of sql serverDivya Sharma
 
Chapter 5: Accounting in ERP Systems
Chapter 5: Accounting in ERP SystemsChapter 5: Accounting in ERP Systems
Chapter 5: Accounting in ERP SystemsQuang Ngoc
 
Information system in business an introduction
Information system in business   an introductionInformation system in business   an introduction
Information system in business an introductionRavi Sidhu
 
FlashSystem 7300 Midrange Enterprise for Hybrid Cloud L2 Sellers Presentation...
FlashSystem 7300 Midrange Enterprise for Hybrid Cloud L2 Sellers Presentation...FlashSystem 7300 Midrange Enterprise for Hybrid Cloud L2 Sellers Presentation...
FlashSystem 7300 Midrange Enterprise for Hybrid Cloud L2 Sellers Presentation...ssuserecfcc8
 
Polymorphic Table Functions in SQL
Polymorphic Table Functions in SQLPolymorphic Table Functions in SQL
Polymorphic Table Functions in SQLChris Saxon
 
Lesson 1 introduction to oracle programming
Lesson 1   introduction to oracle programmingLesson 1   introduction to oracle programming
Lesson 1 introduction to oracle programmingACLC Antipolo
 
Oracle db architecture
Oracle db architectureOracle db architecture
Oracle db architectureSimon Huang
 
Unit 3 object analysis-classification
Unit 3 object analysis-classificationUnit 3 object analysis-classification
Unit 3 object analysis-classificationgopal10scs185
 
User, roles and privileges
User, roles and privilegesUser, roles and privileges
User, roles and privilegesYogiji Creations
 
Data Warehouse Architecture.pptx
Data Warehouse Architecture.pptxData Warehouse Architecture.pptx
Data Warehouse Architecture.pptx22PCS007ANBUF
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architectureAmrit Kaur
 
Presentation database security audit vault & database firewall
Presentation   database security audit vault & database firewallPresentation   database security audit vault & database firewall
Presentation database security audit vault & database firewallxKinAnx
 

Was ist angesagt? (20)

Less08 users
Less08 usersLess08 users
Less08 users
 
ManageEngine ADAudit Plus
ManageEngine ADAudit PlusManageEngine ADAudit Plus
ManageEngine ADAudit Plus
 
Database backup & recovery
Database backup & recoveryDatabase backup & recovery
Database backup & recovery
 
Tips and Tricks for SAP Sybase ASE
Tips and Tricks for SAP Sybase ASETips and Tricks for SAP Sybase ASE
Tips and Tricks for SAP Sybase ASE
 
Sql parametrized queries
Sql parametrized queriesSql parametrized queries
Sql parametrized queries
 
Exadata_X10M-Hardware-Overview.pdf
Exadata_X10M-Hardware-Overview.pdfExadata_X10M-Hardware-Overview.pdf
Exadata_X10M-Hardware-Overview.pdf
 
Physical architecture of sql server
Physical architecture of sql serverPhysical architecture of sql server
Physical architecture of sql server
 
Chapter 5: Accounting in ERP Systems
Chapter 5: Accounting in ERP SystemsChapter 5: Accounting in ERP Systems
Chapter 5: Accounting in ERP Systems
 
Information system in business an introduction
Information system in business   an introductionInformation system in business   an introduction
Information system in business an introduction
 
FlashSystem 7300 Midrange Enterprise for Hybrid Cloud L2 Sellers Presentation...
FlashSystem 7300 Midrange Enterprise for Hybrid Cloud L2 Sellers Presentation...FlashSystem 7300 Midrange Enterprise for Hybrid Cloud L2 Sellers Presentation...
FlashSystem 7300 Midrange Enterprise for Hybrid Cloud L2 Sellers Presentation...
 
Polymorphic Table Functions in SQL
Polymorphic Table Functions in SQLPolymorphic Table Functions in SQL
Polymorphic Table Functions in SQL
 
Lesson 1 introduction to oracle programming
Lesson 1   introduction to oracle programmingLesson 1   introduction to oracle programming
Lesson 1 introduction to oracle programming
 
Oracle db architecture
Oracle db architectureOracle db architecture
Oracle db architecture
 
Unit 3 object analysis-classification
Unit 3 object analysis-classificationUnit 3 object analysis-classification
Unit 3 object analysis-classification
 
User, roles and privileges
User, roles and privilegesUser, roles and privileges
User, roles and privileges
 
Data Warehouse Architecture.pptx
Data Warehouse Architecture.pptxData Warehouse Architecture.pptx
Data Warehouse Architecture.pptx
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architecture
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
MySQL Security
MySQL SecurityMySQL Security
MySQL Security
 
Presentation database security audit vault & database firewall
Presentation   database security audit vault & database firewallPresentation   database security audit vault & database firewall
Presentation database security audit vault & database firewall
 

Ähnlich wie Fast, Big and Persistent Queue Library BigQueue

StorageQuery: federated querying on object stores, powered by Alluxio and Presto
StorageQuery: federated querying on object stores, powered by Alluxio and PrestoStorageQuery: federated querying on object stores, powered by Alluxio and Presto
StorageQuery: federated querying on object stores, powered by Alluxio and PrestoAlluxio, Inc.
 
Apache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesdayApache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesdayAndrei Savu
 
Java 7 Features and Enhancements
Java 7 Features and EnhancementsJava 7 Features and Enhancements
Java 7 Features and EnhancementsGagan Agrawal
 
Project Tungsten: Bringing Spark Closer to Bare Metal
Project Tungsten: Bringing Spark Closer to Bare MetalProject Tungsten: Bringing Spark Closer to Bare Metal
Project Tungsten: Bringing Spark Closer to Bare MetalDatabricks
 
What’s new in Alluxio 2: from seamless operations to structured data management
What’s new in Alluxio 2: from seamless operations to structured data managementWhat’s new in Alluxio 2: from seamless operations to structured data management
What’s new in Alluxio 2: from seamless operations to structured data managementAlluxio, Inc.
 
Speeding Up Spark Performance using Alluxio at China Unicom
Speeding Up Spark Performance using Alluxio at China UnicomSpeeding Up Spark Performance using Alluxio at China Unicom
Speeding Up Spark Performance using Alluxio at China UnicomAlluxio, Inc.
 
Fedora Overview
Fedora OverviewFedora Overview
Fedora Overvieweposthumus
 
dotMemory 4 - What's inside?
dotMemory 4 - What's inside?dotMemory 4 - What's inside?
dotMemory 4 - What's inside?Maarten Balliauw
 
[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf
[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf
[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdfMukundThakur22
 
Alluxio Use Cases at Strata+Hadoop World Beijing 2016
Alluxio Use Cases at Strata+Hadoop World Beijing 2016Alluxio Use Cases at Strata+Hadoop World Beijing 2016
Alluxio Use Cases at Strata+Hadoop World Beijing 2016Alluxio, Inc.
 
Reproducibility and automation of machine learning process
Reproducibility and automation of machine learning processReproducibility and automation of machine learning process
Reproducibility and automation of machine learning processDenis Dus
 
Goroutine stack and local variable allocation in Go
Goroutine stack and local variable allocation in GoGoroutine stack and local variable allocation in Go
Goroutine stack and local variable allocation in GoYu-Shuan Hsieh
 
Hidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-PersistenceHidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-PersistenceSven Ruppert
 
EUDAT Generic Execution Framework
EUDAT Generic Execution FrameworkEUDAT Generic Execution Framework
EUDAT Generic Execution FrameworkEUDAT
 
Kqueue : Generic Event notification
Kqueue : Generic Event notificationKqueue : Generic Event notification
Kqueue : Generic Event notificationMahendra M
 
XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014Vincent Massol
 
06 file processing
06 file processing06 file processing
06 file processingIssay Meii
 

Ähnlich wie Fast, Big and Persistent Queue Library BigQueue (20)

StorageQuery: federated querying on object stores, powered by Alluxio and Presto
StorageQuery: federated querying on object stores, powered by Alluxio and PrestoStorageQuery: federated querying on object stores, powered by Alluxio and Presto
StorageQuery: federated querying on object stores, powered by Alluxio and Presto
 
Apache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesdayApache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesday
 
Java 7 Features and Enhancements
Java 7 Features and EnhancementsJava 7 Features and Enhancements
Java 7 Features and Enhancements
 
Project Tungsten: Bringing Spark Closer to Bare Metal
Project Tungsten: Bringing Spark Closer to Bare MetalProject Tungsten: Bringing Spark Closer to Bare Metal
Project Tungsten: Bringing Spark Closer to Bare Metal
 
What’s new in Alluxio 2: from seamless operations to structured data management
What’s new in Alluxio 2: from seamless operations to structured data managementWhat’s new in Alluxio 2: from seamless operations to structured data management
What’s new in Alluxio 2: from seamless operations to structured data management
 
Speeding Up Spark Performance using Alluxio at China Unicom
Speeding Up Spark Performance using Alluxio at China UnicomSpeeding Up Spark Performance using Alluxio at China Unicom
Speeding Up Spark Performance using Alluxio at China Unicom
 
Fedora Overview
Fedora OverviewFedora Overview
Fedora Overview
 
PyCon Estonia 2019
PyCon Estonia 2019PyCon Estonia 2019
PyCon Estonia 2019
 
dotMemory 4 - What's inside?
dotMemory 4 - What's inside?dotMemory 4 - What's inside?
dotMemory 4 - What's inside?
 
Hadoop Vectored IO
Hadoop Vectored IOHadoop Vectored IO
Hadoop Vectored IO
 
[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf
[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf
[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf
 
Alluxio Use Cases at Strata+Hadoop World Beijing 2016
Alluxio Use Cases at Strata+Hadoop World Beijing 2016Alluxio Use Cases at Strata+Hadoop World Beijing 2016
Alluxio Use Cases at Strata+Hadoop World Beijing 2016
 
Reproducibility and automation of machine learning process
Reproducibility and automation of machine learning processReproducibility and automation of machine learning process
Reproducibility and automation of machine learning process
 
Mutexes 2
Mutexes 2Mutexes 2
Mutexes 2
 
Goroutine stack and local variable allocation in Go
Goroutine stack and local variable allocation in GoGoroutine stack and local variable allocation in Go
Goroutine stack and local variable allocation in Go
 
Hidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-PersistenceHidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-Persistence
 
EUDAT Generic Execution Framework
EUDAT Generic Execution FrameworkEUDAT Generic Execution Framework
EUDAT Generic Execution Framework
 
Kqueue : Generic Event notification
Kqueue : Generic Event notificationKqueue : Generic Event notification
Kqueue : Generic Event notification
 
XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014
 
06 file processing
06 file processing06 file processing
06 file processing
 

Mehr von William Yang

MicroServices architecture @ Ctrip v1.1
MicroServices architecture @ Ctrip v1.1MicroServices architecture @ Ctrip v1.1
MicroServices architecture @ Ctrip v1.1William Yang
 
Antifragile, Microservices and DevOps - A Study
Antifragile, Microservices and DevOps - A StudyAntifragile, Microservices and DevOps - A Study
Antifragile, Microservices and DevOps - A StudyWilliam Yang
 
Luxun a Persistent Messaging System Tailored for Big Data Collecting & Analytics
Luxun a Persistent Messaging System Tailored for Big Data Collecting & AnalyticsLuxun a Persistent Messaging System Tailored for Big Data Collecting & Analytics
Luxun a Persistent Messaging System Tailored for Big Data Collecting & AnalyticsWilliam Yang
 
Easy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with PicoEasy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with PicoWilliam Yang
 

Mehr von William Yang (6)

MicroServices architecture @ Ctrip v1.1
MicroServices architecture @ Ctrip v1.1MicroServices architecture @ Ctrip v1.1
MicroServices architecture @ Ctrip v1.1
 
Antifragile, Microservices and DevOps - A Study
Antifragile, Microservices and DevOps - A StudyAntifragile, Microservices and DevOps - A Study
Antifragile, Microservices and DevOps - A Study
 
From SOA to MSA
From SOA to MSAFrom SOA to MSA
From SOA to MSA
 
Nano
NanoNano
Nano
 
Luxun a Persistent Messaging System Tailored for Big Data Collecting & Analytics
Luxun a Persistent Messaging System Tailored for Big Data Collecting & AnalyticsLuxun a Persistent Messaging System Tailored for Big Data Collecting & Analytics
Luxun a Persistent Messaging System Tailored for Big Data Collecting & Analytics
 
Easy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with PicoEasy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with Pico
 

Kürzlich hochgeladen

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Kürzlich hochgeladen (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Fast, Big and Persistent Queue Library BigQueue

  • 1. BigQueue A Big, Fast and Persistent Queue - by William http://bulldog2011.github.com/
  • 2. Feature Highlights  Fast  enqueue and dequeue are close to O(1) direct memory access.  Big  Only limited by available disk space.  Persistent  Data is persisted on disk and is crash resistant.  Reliable  OS will be responsible for message persistence even your process crashes.  Realtime  Produced messages will be immediately visible to consumers  Flexible Queue Semantics  Consume once queue, fanout queue, can even consume by index  Memory-efficient  Automatic pagging & swapping algorithm, only most recently accessed data is kept in memory.  Thread-safe  Multiple threads can concurrently enqueue and dequeue without data corruption.  Simple & Light-weight  Current library jar is less than 40K.
  • 3. Performance Highlights  In concurrent producing and consuming case, average throughput is around 166MBps.  In sequential producing then consuming case, average throughput is around 333MBps.
  • 4. Design – Logical View  Looks just like a big array or a circular array
  • 5. Design – Consume Once and Fanout Semantics Support
  • 6. Design – Physical View : Paged Index + Data File
  • 8. Design – Dynamic View : Memory Mapped Sliding Window
  • 9. Concurrency  Produce(or append) is synchronized in the queue implementation  Consume(or read) is already thread-safe
  • 10. Simple Interface  Creation IBigQueue bigQueue = new BigQueueImpl("d:/bigqueue/tutorial", "demo");  Enqueue for(int i = 0; i < 10; i++) { String item = String.valueOf(i); bigQueue.enqueue(item.getBytes()); }  Dequeue for(int i = 0; i < 5; i++) { String item = new String(bigQueue.dequeue()); }  Peek byte[] data = bigQueue.peek();
  • 11. Fanout Queue  Creation IFanOutQueue foQueue = new FanOutQueueImpl("d:/tutorial/fanout-queue", "demo");  Enqueue for(int i = 0; i < 10; i++) { String log = "log-" + i; foQueue.enqueue(log.getBytes()); }  Fanout 1 Dequeue String fanoutId1 = "realtime"; while(!foQueue.isEmpty(fanoutId1)) { String item = new String(foQueue.dequeue(fanoutId1)); System.out.println(item); }  Fanout 2 Dequeue String fanoutId2 = "offline"; while(!foQueue.isEmpty(fanoutId2)) { String item = new String(foQueue.dequeue(fanoutId2)); System.out.println(item); } Fanout 1 and Fanout 2 consuming are independent
  • 13. Use Case 1 : Log Collecting & Consuming
  • 14. Use Case 2 : Big Data Sorting  Queue Only Algorithm: 1. Put all data into a source queue 2. Build a queueOfSortedQueues by dividing and sorting the source queue 3. Merge sort the queueOfSortedQueues 4. The last one left in the queueOfSortedQueues is the final sorted queue
  • 15. Source, Samples, Docs and Tutorials https://github.com/bulldog2011/bigqueue
  • 16. Other Alternatives  Apache ActiveMQ  http://activemq.apache.org  RabbitMQ  http://www.rabbitmq.com/  ZeroMQ  http://www.zeromq.org  Kestrel  https://github.com/robey/kestrel  Apache Kafka  http://kafka.apache.org