public synchronized DataSourceService getDataSource() {
        try {
            
            // Embedded storage is used by default in stand-alone mode
            // In cluster mode, external databases are used by default
            
            if (DatasourceConfiguration.isEmbeddedStorage()) {
                if (localDataSourceService == null) {
                    localDataSourceService = new LocalDataSourceServiceImpl();
                    localDataSourceService.init();
                }
                return localDataSourceService;
            } else {
                if (basicDataSourceService == null) {
                    basicDataSourceService = new ExternalDataSourceServiceImpl();
                    basicDataSourceService.init();
                }
                return basicDataSourceService;
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
@Test
    void testGetDataSource() {
        DatasourceConfiguration.setEmbeddedStorage(true);
        assertTrue(dataSource.getDataSource() instanceof LocalDataSourceServiceImpl);
        
        DatasourceConfiguration.setEmbeddedStorage(false);
        assertTrue(dataSource.getDataSource() instanceof ExternalDataSourceServiceImpl);
    }