Home
Explore
Submit Search
Upload
Login
Signup
Advertisement
Check these out next
Tibco iprocess suite
adlearnings technology
This is how we REST
ColdFusionConference
Introduction to Laravel 5.6 new features by perfect web solutions
Imran Qasim
Akmal Khaleeq Waheed - Challenge 3 p3
tovmug
Symfony Nano Framework
Loïc Faugeron
OSX Complex Application Challenge Architecture
CocoaHeads France
psCloudstack Internals
Hans van Veen
2021.laravelconf.tw.slides1
LiviaLiaoFontech
1
of
11
Top clipped slide
Switching to the new EngineFacade
Oct. 12, 2016
•
0 likes
0 likes
×
Be the first to like this
Show More
•
448 views
views
×
Total views
0
On Slideshare
0
From embeds
0
Number of embeds
0
Download Now
Download to read offline
Report
Engineering
A brief overview of what EngineFacade is and why consuming projects in OpenStack should care.
Roman Podoliaka
Follow
Development Manager at Mirantis
Advertisement
Advertisement
Advertisement
Recommended
Apache Felix Web Console
Felix Meschberger
2.4K views
•
14 slides
Server-side OSGi with Apache Sling (Jazoon 2010)
Felix Meschberger
2.2K views
•
31 slides
Server-side OSGi with Apache Sling
Felix Meschberger
20 views
•
30 slides
Flask
Elita Lobo
1.5K views
•
10 slides
Tamir Dresher - What’s new in ASP.NET Core 6
Tamir Dresher
130 views
•
23 slides
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
mfrancis
1.9K views
•
16 slides
More Related Content
Slideshows for you
(8)
Tibco iprocess suite
adlearnings technology
•
66 views
This is how we REST
ColdFusionConference
•
971 views
Introduction to Laravel 5.6 new features by perfect web solutions
Imran Qasim
•
211 views
Akmal Khaleeq Waheed - Challenge 3 p3
tovmug
•
452 views
Symfony Nano Framework
Loïc Faugeron
•
454 views
OSX Complex Application Challenge Architecture
CocoaHeads France
•
4.6K views
psCloudstack Internals
Hans van Veen
•
327 views
2021.laravelconf.tw.slides1
LiviaLiaoFontech
•
357 views
Similar to Switching to the new EngineFacade
(20)
How To Start Up With PHP In IBM i
Sam Pinkhasov
•
1.3K views
How To Start Up With Php In Ibm I
Alex Frenkel
•
4.8K views
Deep Dive Java 17 Devoxx UK
José Paumard
•
742 views
Developing Java Web Applications
hchen1
•
16.4K views
Integrating Ansible Tower with security orchestration and cloud management
Joel W. King
•
995 views
How to Dockerize your Sitecore module
Mihály Árvai
•
465 views
Development withforce
adm_exoplatform
•
767 views
Building Restful Web App Rapidly in CakePHP
Edureka!
•
836 views
Flask Introduction - Python Meetup
Areski Belaid
•
4.3K views
MongoDB - How to model and extract your data
Francesco Lo Franco
•
1.3K views
Rapid Development With CakePHP
Edureka!
•
1.6K views
How to dockerize rails application compose and rails tutorial
Katy Slemon
•
42 views
Building web framework with Rack
sickill
•
3.6K views
One Click Provisioning With Enterprise Manager 12c
Josh Turner
•
305 views
Principles of MVC for Rails Developers
Edureka!
•
1.6K views
Java dev mar_2021_keynote
Suyash Joshi
•
48 views
Rails Engine | Modular application
mirrec
•
6.3K views
Intro to Laravel 4
Singapore PHP User Group
•
5K views
What's new in Airflow 2.3?
Kaxil Naik
•
79 views
Using advanced C# features in Sharepoint development
sadomovalex
•
1.1K views
Advertisement
Recently uploaded
(20)
Error Correction.ppt
nasseralnemer
•
0 views
2. Ford_Dunton_Introductions_CRM.pdf
PROFIBUS and PROFINET InternationaI - PI UK
•
0 views
Presentation Paper C2020-14902_4_3.pptx
ssuserbeb5662
•
0 views
Lec_6_N10.pdf
BorchalaDareje
•
0 views
Final PPT.pptx
Kiran Kumar B M
•
0 views
PPT 4 (1).pdf
AmanBatra31
•
0 views
ECE Time Table .docx
MukulRawat40
•
0 views
IOT AND ARTIFICIAL INTELLIGENCE BASED SMART GARDENING AND IRRIGATION SYSTEM.pdf
Samira Akter Tumpa
•
0 views
10. PI_Dunton - OT Security.pdf
PROFIBUS and PROFINET InternationaI - PI UK
•
0 views
Presentation2.pptx
WaqasGul9
•
0 views
AIDRC_Generative_AI_TL_v5.pdf
Thierry Lestable
•
0 views
fire-safety.ppt
SAIKATKrSAMANTA
•
0 views
ass 1.pdf
AdityaNagare2
•
0 views
hina ppt.pptx
NidaPrincess
•
0 views
lec_8 best nlc.pdf
BorchalaDareje
•
0 views
Fire_Training.ppt
SAIKATKrSAMANTA
•
0 views
Chapter 3.pptx
EsubalewMulat2
•
0 views
Cold Plasma.pptx
014SamriddhiChakrabo
•
0 views
Соболев Д.А. Экспериментальные самолёты России 1912-1941 (2015).pdf
TahirSadikovi
•
0 views
Benefits of Vacuum Insulated Windows.pptx
Jeff Guest
•
0 views
Switching to the new EngineFacade
Switching to the new EngineFacade by Roman Podoliaka @rpodoliaka irc: rpodolyaka rpodolyaka@mirantis.com slides: http://podoliaka.org/talks/
The new EngineFacade spec: https://specs.openstack.org/openstack/oslo specs/specs/kilo/makeenginefacadeafacade.html implemented by zzzeek (Mike Bayer) in Liberty (oslo.db >= 1.12.0) a new clean API for using of oslo.db threadsafe initialization declarative management of session / connection scope easier offloading of readonly transactions to asynchronous replicas
"old" EngineFacade: threadsafe initialization is left up to users _ENGINE_FACADE = None _LOCK = threading.Lock() def _create_facade_lazily(): global _LOCK, _ENGINE_FACADE if _ENGINE_FACADE is None: with _LOCK: if _ENGINE_FACADE is None: _ENGINE_FACADE = db_session.EngineFacade.from_ return _ENGINE_FACADE
"new" EngineFacade: lazy threadsafe initialization from oslo.db import enginefacade as sql @sql.reader def some_api_method(context): # work with context.session @sql.writer def some_other_api_method(context): # work with context.session
"new" EngineFacade: multiple instances of EngineFacade main_context_manager = sql.transaction_context() api_context_manager = sql.transaction_context()
"new" EngineFacade: project specific configuration context_manager = enginefacade.transaction_context() context_manager.configure(sqlite_fk=True) context_manager.append_on_engine_create(set_hook)
"old" EngineFacade: get_session() boilerplate @require_context @handle_db_data_error def snapshot_create(context, values): values['snapshot_metadata'] = _metadata_refs(values.get('metadata'), models.SnapshotMetadata) if not values.get('id'): values['id'] = str(uuid.uuid4()) session = get_session() with session.begin(): snapshot_ref = models.Snapshot() snapshot_ref.update(values) session.add(snapshot_ref) return _snapshot_get(context, values['id'], session=session)
"old" EngineFacade: private DB API functions @require_context def _snapshot_metadata_get(context, snapshot_id, session=None): rows = _snapshot_metadata_get_query( context,snapshot_id, session).all() result = {} for row in rows: result[row['key']] = row['value'] return result
"new" EngineFacade: session scope is managed declaratively @main_context_manager.writer def quota_destroy_all_by_project_and_user(context, project_id, user_id): model_query(context, models.ProjectUserQuota, read_deleted="no"). filter_by(project_id=project_id). filter_by(user_id=user_id). soft_delete(synchronize_session=False)
What projects are already using the new EngineFacade? Nova Neutron Ironic Keystone ...
Need help? Slides: http://podoliaka.org/talks/ Bugs: https://bugs.launchpad.net/oslo.db Questions: IRC #openstackoslo at freenode zzzeek (Mike Bayer) rpodolyaka (Roman Podoliaka) ML http://lists.openstack.org/cgi bin/mailman/listinfo/openstackdev tag with [oslo][db]
Advertisement